Skip to content

Lints about unsafe {} blocks propagate inside macros #74838

Open
@poliorcetics

Description

@poliorcetics

Coming from #74200.

I used #![deny(unsafe_op_in_unsafe_fn)] in std/panicking.rs. This raised an error about a missing unsafe {} block in std/thread/local.rs. Adding it raised a warning about extraneous unsafe {} in other parts of the code. This forced me to use #[allow(unused_unsafe)].

It was noted that lints like those (whatever those is) should maybe not propagate inside macros.

cc @Mark-Simulacrum who raised the point in the first place

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions