diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-06-12 10:21:30 +0200 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-06-12 12:26:27 +0200 |
| commit | 2e7e52e07cec3adb2b14ce17faffe039216ed9d7 (patch) | |
| tree | 1c9b4d76d0288c4ab8c76a2e04b589249de35632 /tests/ui/enum/dead-code-associated-function.stderr | |
| parent | 975741c29417034e9026e53fba16f3b7d5c5721b (diff) | |
| download | rust-2e7e52e07cec3adb2b14ce17faffe039216ed9d7.tar.gz rust-2e7e52e07cec3adb2b14ce17faffe039216ed9d7.zip | |
detect when variants have the same name as an associated function
Diffstat (limited to 'tests/ui/enum/dead-code-associated-function.stderr')
| -rw-r--r-- | tests/ui/enum/dead-code-associated-function.stderr | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/enum/dead-code-associated-function.stderr b/tests/ui/enum/dead-code-associated-function.stderr index df968783c27..e3c1a4c81a4 100644 --- a/tests/ui/enum/dead-code-associated-function.stderr +++ b/tests/ui/enum/dead-code-associated-function.stderr @@ -10,6 +10,16 @@ LL | fn F() {} LL | const C: () = (); | ^ | +note: it is impossible to refer to the associated function `F` because it is shadowed by this enum variant with the same name + --> $DIR/dead-code-associated-function.rs:5:5 + | +LL | F(), + | ^ +note: it is impossible to refer to the associated constant `C` because it is shadowed by this enum variant with the same name + --> $DIR/dead-code-associated-function.rs:6:5 + | +LL | C(), + | ^ note: the lint level is defined here --> $DIR/dead-code-associated-function.rs:2:9 | |
