Closed
Description
In other words, the following will result in a lint being emitted today:
unsafe fn _bar() {}
unsafe fn _foo() {
unsafe {
_bar();
}
}
==>
warning: unnecessary `unsafe` block
--> src/lib.rs:4:5
|
3 | unsafe fn _foo() {
| ---------------- because it's nested under this `unsafe` fn
4 | unsafe {
| ^^^^^^ unnecessary `unsafe` block
|
= note: `#[warn(unused_unsafe)]` on by default
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 an unsafe 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.
Metadata
Metadata
Assignees
Labels
Area: Lints (warnings about flaws in source code) such as unused_mut.Category: An issue proposing an enhancement or a PR with one.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.