1
Fork 0
rust/compiler/rustc_lint/src
Yuki Okushi 896a59d8db
Rollup merge of #97266 - est31:unknown_lints_cfg_attr, r=lcnr
Make weird name lints trigger behind cfg_attr

The weird name lints (`unknown_lints`, `renamed_and_removed_lints`), the lints that lint the linting, were previously not firing for lint level declarations behind `cfg_attr`, as they were only running before expansion.

Now, this will give a `unknown_lints` warning:

```Rust
#[cfg_attr(all(), allow(this_lint_does_not_exist))]
fn foo() {}
```

Lint level declarations behind a `cfg_attr` whose condition is not applying are still ignored. So this still won't give a warning:

```Rust
#[cfg_attr(any(), allow(this_lint_does_not_exist))]
fn foo() {}
```

Furthermore, this PR also makes the weird name lints respect level delcarations for *them* that were hidden by `cfg_attr`, making them consistent to other lints. So this will now not issue a warning:

```Rust
#[cfg_attr(all(), allow(unknown_lints))]
mod foo {
    #[allow(does_not_exist)]
    fn foo() {
    }
}
```

Fixes #97094
2022-05-25 07:08:42 +09:00
..
nonstandard_style
array_into_iter.rs errors: span_suggestion takes impl ToString 2022-04-29 02:05:20 +01:00
builtin.rs Remove feature: crate visibility modifier 2022-05-21 14:22:06 -04:00
context.rs Lint single-use-lifetimes on the AST. 2022-05-20 12:26:37 +02:00
early.rs Emit weird lint name lints after expansion 2022-05-24 17:27:34 +02:00
enum_intrinsics_non_enums.rs initial revert 2022-01-15 01:16:55 +00:00
expect.rs Move lint expectation checking into a separate query (RFC 2383) 2022-05-08 14:37:14 +02:00
hidden_unicode_codepoints.rs Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
internal.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
late.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
levels.rs Lint single-use-lifetimes on the AST. 2022-05-20 12:26:37 +02:00
lib.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
methods.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
non_ascii_idents.rs rustc_error: make ErrorReported impossible to construct 2022-03-16 10:35:24 -05:00
non_fmt_panic.rs Make rustc_parse_format compile on stable 2022-05-03 11:26:58 +02:00
nonstandard_style.rs Stop visiting visibility. 2022-04-23 09:53:45 +02:00
noop_method_call.rs Spellchecking compiler comments 2022-03-30 15:14:15 -04:00
pass_by_value.rs Improve AdtDef interning. 2022-03-11 13:31:24 +11:00
passes.rs Do not pass hir::Crate to lints. 2021-09-30 17:39:54 +02:00
redundant_semicolon.rs Lint on redundant trailing semicolon after item 2020-12-29 16:30:02 -05:00
tests.rs Update to last upstream version 2021-07-08 17:14:28 +02:00
traits.rs Rename ~const Drop to ~const Destruct 2022-03-21 17:04:03 +11:00
types.rs Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
unused.rs only_local: always check for misuse 2022-05-10 12:07:35 +02:00