summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lint/unused/unused_attributes-must_use.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/lint/unused/unused_attributes-must_use.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/lint/unused/unused_attributes-must_use.stderr')
-rw-r--r--src/test/ui/lint/unused/unused_attributes-must_use.stderr175
1 files changed, 175 insertions, 0 deletions
diff --git a/src/test/ui/lint/unused/unused_attributes-must_use.stderr b/src/test/ui/lint/unused/unused_attributes-must_use.stderr
new file mode 100644
index 000000000..317d81c59
--- /dev/null
+++ b/src/test/ui/lint/unused/unused_attributes-must_use.stderr
@@ -0,0 +1,175 @@
+error: unused attribute `must_use`
+ --> $DIR/unused_attributes-must_use.rs:58:1
+ |
+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!("");
+ | ^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to an extern crate
+ --> $DIR/unused_attributes-must_use.rs:5:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a module
+ --> $DIR/unused_attributes-must_use.rs:8:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a use
+ --> $DIR/unused_attributes-must_use.rs:11:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a constant item
+ --> $DIR/unused_attributes-must_use.rs:14:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a static item
+ --> $DIR/unused_attributes-must_use.rs:16:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to an implementation block
+ --> $DIR/unused_attributes-must_use.rs:33:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a foreign module
+ --> $DIR/unused_attributes-must_use.rs:47:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a type alias
+ --> $DIR/unused_attributes-must_use.rs:61:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a type parameter
+ --> $DIR/unused_attributes-must_use.rs:64:8
+ |
+LL | fn qux<#[must_use] T>(_: T) {}
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to an implementation block
+ --> $DIR/unused_attributes-must_use.rs:79:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a trait alias
+ --> $DIR/unused_attributes-must_use.rs:84:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a macro def
+ --> $DIR/unused_attributes-must_use.rs:87:1
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a statement
+ --> $DIR/unused_attributes-must_use.rs:95:5
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a closure
+ --> $DIR/unused_attributes-must_use.rs:99:13
+ |
+LL | let x = #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to an match arm
+ --> $DIR/unused_attributes-must_use.rs:121:9
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to an associated const
+ --> $DIR/unused_attributes-must_use.rs:68:5
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to an associated type
+ --> $DIR/unused_attributes-must_use.rs:70:5
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: `#[must_use]` has no effect when applied to a foreign static item
+ --> $DIR/unused_attributes-must_use.rs:50:5
+ |
+LL | #[must_use]
+ | ^^^^^^^^^^^
+
+error: unused `X` that must be used
+ --> $DIR/unused_attributes-must_use.rs:103:5
+ |
+LL | X;
+ | ^^
+ |
+note: the lint level is defined here
+ --> $DIR/unused_attributes-must_use.rs:2:28
+ |
+LL | #![deny(unused_attributes, unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+
+error: unused `Y` that must be used
+ --> $DIR/unused_attributes-must_use.rs:104:5
+ |
+LL | Y::Z;
+ | ^^^^^
+
+error: unused `U` that must be used
+ --> $DIR/unused_attributes-must_use.rs:105:5
+ |
+LL | U { unit: () };
+ | ^^^^^^^^^^^^^^^
+
+error: unused return value of `U::method` that must be used
+ --> $DIR/unused_attributes-must_use.rs:106:5
+ |
+LL | U::method();
+ | ^^^^^^^^^^^^
+
+error: unused return value of `foo` that must be used
+ --> $DIR/unused_attributes-must_use.rs:107:5
+ |
+LL | foo();
+ | ^^^^^^
+
+error: unused return value of `foreign_foo` that must be used
+ --> $DIR/unused_attributes-must_use.rs:110:9
+ |
+LL | foreign_foo();
+ | ^^^^^^^^^^^^^^
+
+error: unused return value of `Use::get_four` that must be used
+ --> $DIR/unused_attributes-must_use.rs:118:5
+ |
+LL | ().get_four();
+ | ^^^^^^^^^^^^^^
+
+error: aborting due to 26 previous errors
+