diff options
| author | Urgau <urgau@numericable.fr> | 2025-06-17 23:27:06 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2025-06-18 00:06:37 +0200 |
| commit | 42bb66add31d196bb8d0f0bfb79a00dfd2cad55b (patch) | |
| tree | 3e9ed8a4221ed03888393ac9b2448acf5c2eeb34 /tests/ui/lint/lint-non-uppercase-usages.stderr | |
| parent | 994794a50bd4adfd7f0351872206e170c1bc8d58 (diff) | |
| download | rust-42bb66add31d196bb8d0f0bfb79a00dfd2cad55b.tar.gz rust-42bb66add31d196bb8d0f0bfb79a00dfd2cad55b.zip | |
Also emit suggestions for usages in the `non_upper_case_globals` lint
Diffstat (limited to 'tests/ui/lint/lint-non-uppercase-usages.stderr')
| -rw-r--r-- | tests/ui/lint/lint-non-uppercase-usages.stderr | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-non-uppercase-usages.stderr b/tests/ui/lint/lint-non-uppercase-usages.stderr new file mode 100644 index 00000000000..fa47b4ba6a8 --- /dev/null +++ b/tests/ui/lint/lint-non-uppercase-usages.stderr @@ -0,0 +1,64 @@ +warning: constant `my_static` should have an upper case name + --> $DIR/lint-non-uppercase-usages.rs:11:7 + | +LL | const my_static: u32 = 0; + | ^^^^^^^^^ + | + = note: `#[warn(non_upper_case_globals)]` on by default +help: convert the identifier to upper case + | +LL - const my_static: u32 = 0; +LL + const MY_STATIC: u32 = 0; + | +help: convert the identifier to upper case + | +LL - const LOL: u32 = my_static + 0; +LL + const LOL: u32 = MY_STATIC + 0; + | +help: convert the identifier to upper case + | +LL - let _a = crate::my_static; +LL + let _a = crate::MY_STATIC; + | + +warning: constant `fooFOO` should have an upper case name + --> $DIR/lint-non-uppercase-usages.rs:19:12 + | +LL | static fooFOO: Cell<usize> = unreachable!(); + | ^^^^^^ + | +help: convert the identifier to upper case + | +LL - static fooFOO: Cell<usize> = unreachable!(); +LL + static FOO_FOO: Cell<usize> = unreachable!(); + | +help: convert the identifier to upper case + | +LL - fooFOO.set(9); +LL + FOO_FOO.set(9); + | +help: convert the identifier to upper case + | +LL - println!("{}", fooFOO.get()); +LL + println!("{}", FOO_FOO.get()); + | + +warning: const parameter `foo` should have an upper case name + --> $DIR/lint-non-uppercase-usages.rs:24:14 + | +LL | fn foo<const foo: u32>() { + | ^^^ + | +help: convert the identifier to upper case (notice the capitalization difference) + | +LL - fn foo<const foo: u32>() { +LL + fn foo<const FOO: u32>() { + | +help: convert the identifier to upper case (notice the capitalization difference) + | +LL - let _a = foo + 1; +LL + let _a = FOO + 1; + | + +warning: 3 warnings emitted + |
