diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-28 12:14:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-28 12:14:59 +0100 |
| commit | 2ca9b2cdddfbf00c2886a4763c428e4844bf5133 (patch) | |
| tree | 323e9ad8706582e762d40e8da58fe587e61264fc | |
| parent | a4acbd561b96f6c7d5c61df8e6ebc34f9737d1ca (diff) | |
| parent | dfafbc41d8d5befc21f1ee1c009e94053be158e5 (diff) | |
| download | rust-2ca9b2cdddfbf00c2886a4763c428e4844bf5133.tar.gz rust-2ca9b2cdddfbf00c2886a4763c428e4844bf5133.zip | |
Rollup merge of #132253 - Zalathar:keyword-idents-bug, r=jieyouxu
Known-bug test for `keyword_idents` lint not propagating to other files Known-bug test for `keyword_idents` lint not propagating to other files when configured via attribute (#132218).
| -rw-r--r-- | tests/ui/lint/keyword-idents/auxiliary/multi_file_submod.rs | 10 | ||||
| -rw-r--r-- | tests/ui/lint/keyword-idents/multi-file.rs | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/lint/keyword-idents/auxiliary/multi_file_submod.rs b/tests/ui/lint/keyword-idents/auxiliary/multi_file_submod.rs new file mode 100644 index 00000000000..08d6733d3e2 --- /dev/null +++ b/tests/ui/lint/keyword-idents/auxiliary/multi_file_submod.rs @@ -0,0 +1,10 @@ +// Submodule file used by test `../multi-file.rs`. + +// Keywords reserved from Rust 2018: +fn async() {} +fn await() {} +fn try() {} +fn dyn() {} + +// Keywords reserved from Rust 2024: +fn gen() {} diff --git a/tests/ui/lint/keyword-idents/multi-file.rs b/tests/ui/lint/keyword-idents/multi-file.rs new file mode 100644 index 00000000000..703e13f9ef6 --- /dev/null +++ b/tests/ui/lint/keyword-idents/multi-file.rs @@ -0,0 +1,14 @@ +#![deny(keyword_idents)] // Should affect the submodule, but doesn't. +//@ edition: 2015 +//@ known-bug: #132218 +//@ check-pass (known bug; should be check-fail) + +// Because `keyword_idents_2018` and `keyword_idents_2024` are pre-expansion +// lints, configuring them via lint attributes doesn't propagate to submodules +// in other files. +// <https://github.com/rust-lang/rust/issues/132218> + +#[path = "./auxiliary/multi_file_submod.rs"] +mod multi_file_submod; + +fn main() {} |
