about summary refs log tree commit diff
path: root/tests/ui/structs-enums
diff options
context:
space:
mode:
authorr0cky <mu001999@outlook.com>2024-02-07 10:42:01 +0800
committerr0cky <mu001999@outlook.com>2024-02-07 10:42:01 +0800
commitc7519d42c2664828c98fdb98acab73e9a39b0b97 (patch)
tree87e875c88b08158761df546ea4e88902fbb08d6a /tests/ui/structs-enums
parent40878ca6ea79d6e55e430846a2de3350a76cd08f (diff)
downloadrust-c7519d42c2664828c98fdb98acab73e9a39b0b97.tar.gz
rust-c7519d42c2664828c98fdb98acab73e9a39b0b97.zip
Update tests
Diffstat (limited to 'tests/ui/structs-enums')
-rw-r--r--tests/ui/structs-enums/enum-null-pointer-opt.rs2
-rw-r--r--tests/ui/structs-enums/enum-null-pointer-opt.stderr12
2 files changed, 13 insertions, 1 deletions
diff --git a/tests/ui/structs-enums/enum-null-pointer-opt.rs b/tests/ui/structs-enums/enum-null-pointer-opt.rs
index 356f8a6dd36..21564eeec29 100644
--- a/tests/ui/structs-enums/enum-null-pointer-opt.rs
+++ b/tests/ui/structs-enums/enum-null-pointer-opt.rs
@@ -7,7 +7,7 @@ use std::ptr::NonNull;
 use std::rc::Rc;
 use std::sync::Arc;
 
-trait Trait { fn dummy(&self) { } }
+trait Trait { fn dummy(&self) { } } //~ WARN method `dummy` is never used
 trait Mirror { type Image; }
 impl<T> Mirror for T { type Image = T; }
 struct ParamTypeStruct<T>(#[allow(dead_code)] T);
diff --git a/tests/ui/structs-enums/enum-null-pointer-opt.stderr b/tests/ui/structs-enums/enum-null-pointer-opt.stderr
new file mode 100644
index 00000000000..64e93ffaffd
--- /dev/null
+++ b/tests/ui/structs-enums/enum-null-pointer-opt.stderr
@@ -0,0 +1,12 @@
+warning: method `dummy` is never used
+  --> $DIR/enum-null-pointer-opt.rs:10:18
+   |
+LL | trait Trait { fn dummy(&self) { } }
+   |       -----      ^^^^^
+   |       |
+   |       method in this trait
+   |
+   = note: `#[warn(dead_code)]` on by default
+
+warning: 1 warning emitted
+