diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2022-05-25 07:08:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-25 07:08:42 +0900 |
| commit | 896a59d8dbf0387815d1022b4851686b9376ebe7 (patch) | |
| tree | 3f06a0d6cca104f6423f88a0526dd69112e6504a /compiler/rustc_mir_transform/src/coverage/debug.rs | |
| parent | 33f45b167e12f6c84f6f8e9dee90676f97c192e3 (diff) | |
| parent | 2a8b60f915c9fdc61e18be3392ea4330d9617da4 (diff) | |
| download | rust-896a59d8dbf0387815d1022b4851686b9376ebe7.tar.gz rust-896a59d8dbf0387815d1022b4851686b9376ebe7.zip | |
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
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/debug.rs')
0 files changed, 0 insertions, 0 deletions
