We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe5c95d commit d3465bcCopy full SHA for d3465bc
tests/ui/enum/dead-code-associated-function.rs
@@ -0,0 +1,16 @@
1
+//@ check-pass
2
+#![warn(dead_code)]
3
+
4
+enum E {
5
+ V(),
6
+}
7
8
+impl E {
9
+ #[expect(non_snake_case)]
10
+ fn V() {}
11
+ //~^ WARN: associated function `V` is never used
12
13
14
+fn main() {
15
+ let _: E = E::V();
16
tests/ui/enum/dead-code-associated-function.stderr
@@ -0,0 +1,17 @@
+warning: associated function `V` is never used
+ --> $DIR/dead-code-associated-function.rs:10:8
+ |
+LL | impl E {
+ | ------ associated function in this implementation
+LL | #[expect(non_snake_case)]
+LL | fn V() {}
+ | ^
+note: the lint level is defined here
+ --> $DIR/dead-code-associated-function.rs:2:9
+LL | #![warn(dead_code)]
+ | ^^^^^^^^^
+warning: 1 warning emitted
17
0 commit comments