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

Use true previous lint level when detecting overriden forbids #78864

Merged
merged 1 commit into from
Dec 2, 2020

Commits on Nov 14, 2020

  1. Use true previous lint level when detecting overriden forbids

    Previously, cap-lints was ignored when checking the previous forbid level, which
    meant that it was a hard error to do so. This is different from the normal
    behavior of lints, which are silenced by cap-lints; if the forbid would not take
    effect regardless, there is not much point in complaining about the fact that we
    are reducing its level.
    
    It might be considered a bug that even `--cap-lints deny` would suffice to
    silence the error on overriding forbid, depending on if one cares about failing
    the build or precisely forbid being set. But setting cap-lints to deny is quite
    odd and not really done in practice, so we don't try to handle it specially.
    
    This also unifies the code paths for nested and same-level scopes. However, the
    special case for CLI lint flags is left in place (introduced by rust-lang#70918) to fix
    the regression noted in rust-lang#70819. That means that CLI flags do not lint on forbid
    being overridden by a non-forbid level. It is unclear whether this is a bug or a
    desirable feature, but it is certainly inconsistent. CLI flags are a
    sufficiently different "type" of place though that this is deemed out of scope
    for this commit.
    Mark-Simulacrum committed Nov 14, 2020
    Configuration menu
    Copy the full SHA
    64efcbe View commit details
    Browse the repository at this point in the history