about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorEzra Shaw <ezrasure@outlook.com>2023-04-13 23:38:52 +1200
committerEzra Shaw <ezrasure@outlook.com>2023-04-13 23:39:14 +1200
commit39e23ef532fa894f33ffcd105e630955bf315411 (patch)
tree40c580984b4338e564ede6191fd47bde1960f3bb /tests/ui
parentc41dcac8e869160184fc2d80f643bc74601a45ef (diff)
downloadrust-39e23ef532fa894f33ffcd105e630955bf315411.tar.gz
rust-39e23ef532fa894f33ffcd105e630955bf315411.zip
impl reviewer feedback
- remove unused (pun intentional) `continue`
- improve wording with assoc items in general
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/lint/dead-code/unused-assoc-fns.rs14
-rw-r--r--tests/ui/lint/dead-code/unused-assoc-fns.stderr14
2 files changed, 22 insertions, 6 deletions
diff --git a/tests/ui/lint/dead-code/unused-assoc-fns.rs b/tests/ui/lint/dead-code/unused-assoc-fns.rs
index 9e3ad85390a..b111f4b9463 100644
--- a/tests/ui/lint/dead-code/unused-assoc-fns.rs
+++ b/tests/ui/lint/dead-code/unused-assoc-fns.rs
@@ -1,19 +1,29 @@
+#![feature(inherent_associated_types)]
+#![allow(incomplete_features)]
 #![deny(unused)]
 
 struct Foo;
 
 impl Foo {
     fn one() {}
-    //~^ ERROR associated functions `one`, `two`, and `three` are never used [dead_code]
+    //~^ ERROR associated items `one`, `two`, `CONSTANT`, `Type`, and `three` are never used [dead_code]
 
     fn two(&self) {}
 
-    // seperation between functions
+    // seperation between items
     // ...
     // ...
 
     fn used() {}
 
+    const CONSTANT: usize = 5;
+
+    // more seperation
+    // ...
+    // ...
+
+    type Type = usize;
+
     fn three(&self) {
         Foo::one();
         // ...
diff --git a/tests/ui/lint/dead-code/unused-assoc-fns.stderr b/tests/ui/lint/dead-code/unused-assoc-fns.stderr
index 71174a1c3de..6344a70ea3a 100644
--- a/tests/ui/lint/dead-code/unused-assoc-fns.stderr
+++ b/tests/ui/lint/dead-code/unused-assoc-fns.stderr
@@ -1,19 +1,25 @@
-error: associated functions `one`, `two`, and `three` are never used
-  --> $DIR/unused-assoc-fns.rs:6:8
+error: associated items `one`, `two`, `CONSTANT`, `Type`, and `three` are never used
+  --> $DIR/unused-assoc-fns.rs:8:8
    |
 LL | impl Foo {
-   | -------- associated functions in this implementation
+   | -------- associated items in this implementation
 LL |     fn one() {}
    |        ^^^
 ...
 LL |     fn two(&self) {}
    |        ^^^
 ...
+LL |     const CONSTANT: usize = 5;
+   |           ^^^^^^^^
+...
+LL |     type Type = usize;
+   |          ^^^^
+LL |
 LL |     fn three(&self) {
    |        ^^^^^
    |
 note: the lint level is defined here
-  --> $DIR/unused-assoc-fns.rs:1:9
+  --> $DIR/unused-assoc-fns.rs:3:9
    |
 LL | #![deny(unused)]
    |         ^^^^^^