Skip to content
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

Document lint control scoping. #574

Closed
ehuss opened this issue Apr 21, 2019 · 1 comment · Fixed by #998
Closed

Document lint control scoping. #574

ehuss opened this issue Apr 21, 2019 · 1 comment · Fixed by #998
Labels
A-attributes Area: Attributes

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 21, 2019

The diagnostics chapter should explain how allow/deny/etc works when the same rule is applied at different levels. For example:

#[allow(unused)]
{
    #[deny(unused)]
    {
        // Everything here is deny.
    }
}

This is pretty self-evident, but the docs should be explicit how this scoping works (it's fairly unusual attribute behavior).

Also, it should probably mention lint groups. For example:

#[allow(unused)]
{
    #[deny(unused_variables)]
    {
        // all unused lints are allow, except unused_variables.
    }
}
@ehuss ehuss added the A-attributes Area: Attributes label Apr 21, 2019
@ehuss
Copy link
Contributor Author

ehuss commented Oct 7, 2020

rust-lang/rust#77534 changed the behavior of overriding the same lint in the same scope. The rules for that should also be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant