Uh oh!
There was an error while loading. Please reload this page.
Wrap write_bytes in a function. Move docs - #57997
Conversation
rust-highfive
commented
Jan 30, 2019
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @KodrAus (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
nitnelave
commented
Jan 30, 2019
r? @RalfJung |
| /// // Now the box is fine | ||
| /// assert_eq!(*v, 42); | ||
| /// ``` | ||
| #[stable(feature = "rust1", since = "1.0.0")] |
There was a problem hiding this comment.
This should then also be removed, I think.
EDIT: Uh, never mind. This is public.
There was a problem hiding this comment.
Oh never mind. I did not know the functions in this module are pub. What the heck, why do we have public intrinsics?!?
There was a problem hiding this comment.
That's what I was surprised about when writing the wrapper :D
RalfJung
commented
Jan 30, 2019
Cc @rust-lang/libs Please advise: we'd like to replace fnmain(){letmut x = 2;unsafe{
core::intrinsics::write_bytes(&mut x,0,1);}}That's quite bad, obviously, because it allows direct access to the intrinsic. I am seriously surprised that anything in So we could either move this one intrinsic to a submodule, meaning |
SimonSapin
commented
Jan 30, 2019
That In fact I’d be in favor of actively unstabilizing everything in |
nitnelave
commented
Jan 30, 2019
I added the |
alexcrichton
commented
Jan 30, 2019
Wrapping raw intrinsics in new functions has historically caused a noticeable impact to compile times. I'd recommend holding off on landing a PR that wraps everything until we have a perf run at least to evaluate the impact. |
nitnelave
commented
Jan 30, 2019
@alexcrichton That's okay with me. How do I trigger a perf run? Or is it just going to come eventually from the CI? |
alexcrichton
commented
Jan 30, 2019
Oh triggering a perf run currently is still pretty manual. @nitnelave do you want to wrap a few more functions or just this one? Afterwards it's just |
What do we gain from separating this? Anyway this PR currently removes the doc comment from a public stable function, I don't think that's a good idea (don't we have a lint against undocumented functions?).
Hm, I don't see the connection to that issue. EDIT: Oh, I @alexcrichton wrote "The intrinsics module is unstable but the function is stable because it's reexported in std::ptr". I thought we could attach a stability attribute to the reexport, but that doesn't seem to work then.
Ah, that's great! I think it is impossible for |
nitnelave
commented
Jan 30, 2019
I guess we'll eventually also wrap |
RalfJung
commented
Jan 30, 2019
Yes please do. That'll also make the perf impact bigger (if it exists) and hence easier to measure. I'd even use |
Uh oh!
There was an error while loading. Please reload this page.
RalfJung
commented
Jan 30, 2019
Thanks! Let's see what the timing says. @bors try |
bors
commented
Jan 30, 2019
Wrap write_bytes in a function. Move docs This will allow us to add debug assertions. See issue #53871.
SimonSapin
commented
Jan 30, 2019
Yes, but going "through" an unstable module in a path such as |
nitnelave
commented
Feb 4, 2019
@rustc-perf |
nitnelave
commented
Feb 4, 2019
I'm trying to run a benchmark, how do I trigger that? @RalfJung |
@nitnelave Try
|
rust-timer
commented
Feb 4, 2019
Insufficient permissions to issue commands to rust-timer. |
1 similar comment
rust-timer
commented
Feb 4, 2019
Insufficient permissions to issue commands to rust-timer. |
nitnelave
commented
Feb 4, 2019
It shouldn't, but we're trying to assess that, see #57997 (comment)
Who does? Who can I ask? |
tesuji
commented
Feb 4, 2019
Ah, yeah!
If you're not in the whitelist and try to run the timer, the timer will complain. I will try to cc @RalfJung . |
RalfJung
commented
Feb 4, 2019
@rust-timer build 4f8466b |
rust-timer
commented
Feb 4, 2019
Success: Queued 4f8466b with parent 43b4c4a, comparison URL. |
bors
commented
Feb 15, 2019
💔 Test failed - checks-travis |
rust-highfive
commented
Feb 15, 2019
Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
emilyalbini
commented
Feb 15, 2019
@bors retry -- apparently we can't clone the repo anymore on macOS |
This comment has been minimized.
This comment has been minimized.
Wrap write_bytes in a function. Move docs This will allow us to add debug assertions. See issue rust-lang#53871.
Wrap write_bytes in a function. Move docs This will allow us to add debug assertions. See issue rust-lang#53871.
bors
commented
Feb 22, 2019
Wrap write_bytes in a function. Move docs This will allow us to add debug assertions. See issue #53871.
bors
commented
Feb 22, 2019
☀️ Test successful - checks-travis, status-appveyor |
bors
commented
Feb 22, 2019
☀️ Test successful - checks-travis, status-appveyor |
nitnelave
commented
Feb 22, 2019
Yay! \o\ \o\ /o/ /o/ |
The interface, though marked stable, is actually not. See rust-lang/rust#57997.
directly expose copy and copy_nonoverlapping intrinsics This effectively un-does rust-lang#57997. That should help with `ptr::read` codegen in debug builds (and any other of these low-level functions that bottoms out at `copy`/`copy_nonoverlapping`), where the wrapper function will not get inlined. See the discussion in rust-lang#80290 and rust-lang#81163. Cc `@bjorn3` `@therealprof`
directly expose copy and copy_nonoverlapping intrinsics This effectively un-does rust-lang/rust#57997. That should help with `ptr::read` codegen in debug builds (and any other of these low-level functions that bottoms out at `copy`/`copy_nonoverlapping`), where the wrapper function will not get inlined. See the discussion in rust-lang/rust#80290 and rust-lang/rust#81163. Cc `@bjorn3` `@therealprof`
The interface, though marked stable, is actually not. See rust-lang/rust#57997.
This will allow us to add debug assertions.
See issue #53871.