Uh oh!
There was an error while loading. Please reload this page.
Implement RFC 2585: unsafe blocks in unsafe fn - #71862
Conversation
RalfJung
commented
May 3, 2020
I'm afraid I cannot review this, the code is way outside my comfort zone. |
RalfJung
commented
May 3, 2020
Cc @matthewjasper maybe you can help with review? |
LeSeulArtichaut
commented
May 4, 2020
Maybe @hanna-kruppe (who reviewed another PR I had on the same part of the code), if you have some time? |
hanna-kruppe
commented
May 4, 2020
Sorry, I don't have the time. |
LeSeulArtichaut
commented
May 4, 2020
No problem, thanks for answering! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
f4858b1 to
a6bb96cCompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nikomatsakis
commented
May 4, 2020
@RalfJung -- it looks like you've found a bunch of things to work on, can you maybe ping me when the PR is ready for me to take a look? I can assign to you in the meantime..? |
RalfJung
commented
May 4, 2020
I can review the tests, but that's about it. Sure, I'll re-assign to you once those look good to me. |
rust-highfive
commented
May 13, 2020
The job 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 |
LeSeulArtichaut
commented
May 14, 2020
@RalfJung Sorry if I've been inactive lately... I pushed a commit which should address your review. Could you confirm that the test for the RFC looks good now? |
RalfJung
commented
May 14, 2020
@LeSeulArtichaut it's okay, we are not in a rush. :) The tests look much better now, thanks! Could you also test some other unsafe operations besides calling an unsafe function... let's say, dereferencing a raw pointer. Also taking a reference to a packed field is notorious (#27060), it is a warning instead of a hard error, so we should probably test that that interacts properly with the new lint. |
LeSeulArtichaut
commented
May 14, 2020
@RalfJung I pushed 15ec7fd5ff3c5ec92f1155bad202ee00f80e111b, which includes dereferencing a raw pointer, using a static mut and borrowing a packed field. Should I add other stuff, e.g. using a union or doing inline assembly? |
Uh oh!
There was an error while loading. Please reload this page.
e0d57bc to
db684beCompareLeSeulArtichaut
commented
May 27, 2020
Pushed a commit to fix rustdoc failures, and this time I tested it :D |
LeSeulArtichaut
commented
May 28, 2020
@nikomatsakis CI passes now 🎉 In the meantime, I opened #72694 for the feature-gated lints. I developed my implementation plan there and I think I could do it pretty easily. But at the same time I think it might be a good first issue for a new contributor, which I can probably "mentor" (rather guide them in the documentation 😄). Please tell me if the implementation plan seems good and whether I should do it or let someone else do it. |
Uh oh!
There was an error while loading. Please reload this page.
nikomatsakis
commented
May 28, 2020
@bors r+ Thanks for seeing this through, @LeSeulArtichaut! I'll check out #72694 |
bors
commented
May 28, 2020
📌 Commit 0e3b31c has been approved by |
…afe-fn, r=nikomatsakis Implement RFC 2585: unsafe blocks in unsafe fn Tracking issue: rust-lang#71668 r? @RalfJung cc @nikomatsakis
…afe-fn, r=nikomatsakis Implement RFC 2585: unsafe blocks in unsafe fn Tracking issue: rust-lang#71668 r? @RalfJung cc @nikomatsakis
…afe-fn, r=nikomatsakis Implement RFC 2585: unsafe blocks in unsafe fn Tracking issue: rust-lang#71668 r? @RalfJung cc @nikomatsakis
…afe-fn, r=nikomatsakis Implement RFC 2585: unsafe blocks in unsafe fn Tracking issue: rust-lang#71668 r? @RalfJung cc @nikomatsakis
Rollup of 9 pull requests Successful merges: - rust-lang#67460 (Tweak impl signature mismatch errors involving `RegionKind::ReVar` lifetimes) - rust-lang#71095 (impl From<[T; N]> for Box<[T]>) - rust-lang#71500 (Make pointer offset methods/intrinsics const) - rust-lang#71804 (linker: Support `-static-pie` and `-static -shared`) - rust-lang#71862 (Implement RFC 2585: unsafe blocks in unsafe fn) - rust-lang#72103 (borrowck `DefId` -> `LocalDefId`) - rust-lang#72407 (Various minor improvements to Ipv6Addr::Display) - rust-lang#72413 (impl Step for char (make Range*<char> iterable)) - rust-lang#72439 (NVPTX support for new asm!) Failed merges: r? @ghost
…nikomatsakis `#[deny(unsafe_op_in_unsafe_fn)]` in liballoc This PR proposes to make use of the new `unsafe_op_in_unsafe_fn` lint, i.e. no longer consider the body of an unsafe function as an unsafe block and require explicit unsafe block to perform unsafe operations. This has been first (partly) suggested by @Mark-Simulacrum in rust-lang#69245 (comment) Tracking issue for the feature: rust-lang#71668. ~~Blocked on rust-lang#71862.~~ r? @Mark-Simulacrum cc @nikomatsakis can you confirm that those changes are desirable? Should I restrict it to only BTree for the moment?
Tracking issue: #71668
r? @RalfJung cc @nikomatsakis