summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/unused
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/lint/unused')
-rw-r--r--src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr2
-rw-r--r--src/test/ui/lint/unused/must-use-box-from-raw.stderr2
-rw-r--r--src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr2
-rw-r--r--src/test/ui/lint/unused/must_use-tuple.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-attr-duplicate.stderr10
-rw-r--r--src/test/ui/lint/unused/unused-closure.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr2
-rw-r--r--src/test/ui/lint/unused/unused-supertrait.rs11
-rw-r--r--src/test/ui/lint/unused/unused-supertrait.stderr15
-rw-r--r--src/test/ui/lint/unused/unused_attributes-must_use.stderr10
-rw-r--r--src/test/ui/lint/unused/useless-comment.stderr2
12 files changed, 44 insertions, 18 deletions
diff --git a/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr b/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
index 26fa6eb9b..fe2e3afc8 100644
--- a/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
+++ b/src/test/ui/lint/unused/issue-47390-unused-variable-in-struct-pattern.stderr
@@ -49,8 +49,8 @@ warning: value assigned to `hours_are_suns` is never read
LL | hours_are_suns = false;
| ^^^^^^^^^^^^^^
|
- = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
= help: maybe it is overwritten before being read?
+ = note: `#[warn(unused_assignments)]` implied by `#[warn(unused)]`
warning: unused variable: `fire`
--> $DIR/issue-47390-unused-variable-in-struct-pattern.rs:52:32
diff --git a/src/test/ui/lint/unused/must-use-box-from-raw.stderr b/src/test/ui/lint/unused/must-use-box-from-raw.stderr
index 7769f09aa..011acc3bf 100644
--- a/src/test/ui/lint/unused/must-use-box-from-raw.stderr
+++ b/src/test/ui/lint/unused/must-use-box-from-raw.stderr
@@ -4,12 +4,12 @@ warning: unused return value of `Box::<T>::from_raw` that must be used
LL | Box::from_raw(ptr);
| ^^^^^^^^^^^^^^^^^^^
|
+ = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
note: the lint level is defined here
--> $DIR/must-use-box-from-raw.rs:5:9
|
LL | #![warn(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
warning: 1 warning emitted
diff --git a/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr b/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
index 76978d29d..f5199f43c 100644
--- a/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
+++ b/src/test/ui/lint/unused/must_use-in-stdlib-traits.stderr
@@ -4,12 +4,12 @@ error: unused implementer of `Iterator` that must be used
LL | iterator();
| ^^^^^^^^^^^
|
+ = note: iterators are lazy and do nothing unless consumed
note: the lint level is defined here
--> $DIR/must_use-in-stdlib-traits.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: iterators are lazy and do nothing unless consumed
error: unused implementer of `Future` that must be used
--> $DIR/must_use-in-stdlib-traits.rs:43:4
diff --git a/src/test/ui/lint/unused/must_use-tuple.stderr b/src/test/ui/lint/unused/must_use-tuple.stderr
index e5709a5f0..63e0318fb 100644
--- a/src/test/ui/lint/unused/must_use-tuple.stderr
+++ b/src/test/ui/lint/unused/must_use-tuple.stderr
@@ -4,12 +4,12 @@ error: unused `Result` in tuple element 0 that must be used
LL | (Ok::<(), ()>(()),);
| ^^^^^^^^^^^^^^^^
|
+ = note: this `Result` may be an `Err` variant, which should be handled
note: the lint level is defined here
--> $DIR/must_use-tuple.rs:1:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: this `Result` may be an `Err` variant, which should be handled
error: unused `Result` in tuple element 0 that must be used
--> $DIR/must_use-tuple.rs:10:6
diff --git a/src/test/ui/lint/unused/unused-attr-duplicate.stderr b/src/test/ui/lint/unused/unused-attr-duplicate.stderr
index f592323b5..769b17487 100644
--- a/src/test/ui/lint/unused/unused-attr-duplicate.stderr
+++ b/src/test/ui/lint/unused/unused-attr-duplicate.stderr
@@ -4,16 +4,16 @@ error: unused attribute
LL | #[no_link]
| ^^^^^^^^^^ help: remove this attribute
|
-note: the lint level is defined here
- --> $DIR/unused-attr-duplicate.rs:12:9
- |
-LL | #![deny(unused_attributes)]
- | ^^^^^^^^^^^^^^^^^
note: attribute also specified here
--> $DIR/unused-attr-duplicate.rs:32:1
|
LL | #[no_link]
| ^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/unused-attr-duplicate.rs:12:9
+ |
+LL | #![deny(unused_attributes)]
+ | ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/unused-attr-duplicate.rs:37:1
diff --git a/src/test/ui/lint/unused/unused-closure.stderr b/src/test/ui/lint/unused/unused-closure.stderr
index 265d3e8e0..4362abd20 100644
--- a/src/test/ui/lint/unused/unused-closure.stderr
+++ b/src/test/ui/lint/unused/unused-closure.stderr
@@ -6,12 +6,12 @@ LL | | println!("Hello!");
LL | | };
| |______^
|
+ = note: closures are lazy and do nothing unless called
note: the lint level is defined here
--> $DIR/unused-closure.rs:6:9
|
LL | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
- = note: closures are lazy and do nothing unless called
error: unused implementer of `Future` that must be used
--> $DIR/unused-closure.rs:13:5
diff --git a/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
index 1a022c309..078b780d8 100644
--- a/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
+++ b/src/test/ui/lint/unused/unused-doc-comments-edge-cases.stderr
@@ -23,12 +23,12 @@ LL |
LL | _ => false,
| ---------- rustdoc does not generate documentation for match arms
|
+ = help: use `//` for a plain comment
note: the lint level is defined here
--> $DIR/unused-doc-comments-edge-cases.rs:1:9
|
LL | #![deny(unused_doc_comments)]
| ^^^^^^^^^^^^^^^^^^^
- = help: use `//` for a plain comment
error: unused doc comment
--> $DIR/unused-doc-comments-edge-cases.rs:23:5
diff --git a/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr b/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
index f4f5bb71e..26b1c2b05 100644
--- a/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
+++ b/src/test/ui/lint/unused/unused-doc-comments-for-macros.stderr
@@ -8,12 +8,12 @@ LL | | /// line3
| |
| rustdoc does not generate documentation for macro invocations
|
+ = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
note: the lint level is defined here
--> $DIR/unused-doc-comments-for-macros.rs:1:9
|
LL | #![deny(unused_doc_comments)]
| ^^^^^^^^^^^^^^^^^^^
- = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
error: unused doc comment
--> $DIR/unused-doc-comments-for-macros.rs:13:5
diff --git a/src/test/ui/lint/unused/unused-supertrait.rs b/src/test/ui/lint/unused/unused-supertrait.rs
new file mode 100644
index 000000000..64a8e5204
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-supertrait.rs
@@ -0,0 +1,11 @@
+#![deny(unused_must_use)]
+
+fn it() -> impl ExactSizeIterator<Item = ()> {
+ let x: Box<dyn ExactSizeIterator<Item = ()>> = todo!();
+ x
+}
+
+fn main() {
+ it();
+ //~^ ERROR unused implementer of `Iterator` that must be used
+}
diff --git a/src/test/ui/lint/unused/unused-supertrait.stderr b/src/test/ui/lint/unused/unused-supertrait.stderr
new file mode 100644
index 000000000..d2f8c0078
--- /dev/null
+++ b/src/test/ui/lint/unused/unused-supertrait.stderr
@@ -0,0 +1,15 @@
+error: unused implementer of `Iterator` that must be used
+ --> $DIR/unused-supertrait.rs:9:5
+ |
+LL | it();
+ | ^^^^^
+ |
+ = note: iterators are lazy and do nothing unless consumed
+note: the lint level is defined here
+ --> $DIR/unused-supertrait.rs:1:9
+ |
+LL | #![deny(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/lint/unused/unused_attributes-must_use.stderr b/src/test/ui/lint/unused/unused_attributes-must_use.stderr
index dd112c23e..ce959ddbc 100644
--- a/src/test/ui/lint/unused/unused_attributes-must_use.stderr
+++ b/src/test/ui/lint/unused/unused_attributes-must_use.stderr
@@ -4,16 +4,16 @@ error: unused attribute `must_use`
LL | #[must_use]
| ^^^^^^^^^^^
|
-note: the lint level is defined here
- --> $DIR/unused_attributes-must_use.rs:2:9
- |
-LL | #![deny(unused_attributes, unused_must_use)]
- | ^^^^^^^^^^^^^^^^^
note: the built-in attribute `must_use` will be ignored, since it's applied to the macro invocation `global_asm`
--> $DIR/unused_attributes-must_use.rs:59:1
|
LL | global_asm!("");
| ^^^^^^^^^^
+note: the lint level is defined here
+ --> $DIR/unused_attributes-must_use.rs:2:9
+ |
+LL | #![deny(unused_attributes, unused_must_use)]
+ | ^^^^^^^^^^^^^^^^^
error: `#[must_use]` has no effect when applied to an extern crate
--> $DIR/unused_attributes-must_use.rs:5:1
diff --git a/src/test/ui/lint/unused/useless-comment.stderr b/src/test/ui/lint/unused/useless-comment.stderr
index 0054426fb..8bb5bdaeb 100644
--- a/src/test/ui/lint/unused/useless-comment.stderr
+++ b/src/test/ui/lint/unused/useless-comment.stderr
@@ -4,12 +4,12 @@ error: unused doc comment
LL | /// foo
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustdoc does not generate documentation for macro invocations
|
+ = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
note: the lint level is defined here
--> $DIR/useless-comment.rs:3:9
|
LL | #![deny(unused_doc_comments)]
| ^^^^^^^^^^^^^^^^^^^
- = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
error: unused doc comment
--> $DIR/useless-comment.rs:32:5