-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unused_unsafe: stop interpreting unsafe fn
s as unsafe contexts
#69173
Comments
So looking at the code, it seems that the outermost active rust/src/librustc_mir_build/build/block.rs Lines 212 to 216 in dbef353
(NB: very confusing terminology around This are the possible values for Lines 380 to 388 in dbef353
So when the "current safety" is By making this change, I think we can get the desired lint effect (while - Safety::Safe => {}
+ Safety::Safe | Safety::FnUnsafe => {} |
I’m currently trying to tackle this. |
I updated the RFC to discuss the new proposed lint and the interaction with the "unnecessary unsafe" lint. See rust-lang/rfcs#2585 (comment). |
@kevinmehall agreed, thanks. |
In other words, the following will result in a lint being emitted today:
==>
Based on the discussion in a recent language team meeting (see summary as outlined by @nikomatsakis in rust-lang/rfcs#2585 (comment)), we would like to stop emitting the lint in this case where we have unsafe operations inside an
unsafe { ... }
inside anunsafe fn
(it's probably easiest to not emit the lint at all as opposed to emitting a different lint name, but this can be determined as part of the implementation).cc @RalfJung @rust-lang/lang
This issue has been assigned to @LeSeulArtichaut via this comment.
The text was updated successfully, but these errors were encountered: