summaryrefslogtreecommitdiffstats
path: root/tests/ui/lint/dead-code/tuple-struct-field.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/lint/dead-code/tuple-struct-field.stderr
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/lint/dead-code/tuple-struct-field.stderr')
-rw-r--r--tests/ui/lint/dead-code/tuple-struct-field.stderr33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/ui/lint/dead-code/tuple-struct-field.stderr b/tests/ui/lint/dead-code/tuple-struct-field.stderr
new file mode 100644
index 000000000..b8ad5cbe4
--- /dev/null
+++ b/tests/ui/lint/dead-code/tuple-struct-field.stderr
@@ -0,0 +1,33 @@
+error: field `1` is never read
+ --> $DIR/tuple-struct-field.rs:8:26
+ |
+LL | struct SingleUnused(i32, [u8; LEN], String);
+ | ------------ ^^^^^^^^^
+ | |
+ | field in this struct
+ |
+note: the lint level is defined here
+ --> $DIR/tuple-struct-field.rs:1:9
+ |
+LL | #![deny(unused_tuple_struct_fields)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
+ |
+LL | struct SingleUnused(i32, (), String);
+ | ~~
+
+error: fields `0`, `1`, `2`, and `3` are never read
+ --> $DIR/tuple-struct-field.rs:13:23
+ |
+LL | struct MultipleUnused(i32, f32, String, u8);
+ | -------------- ^^^ ^^^ ^^^^^^ ^^
+ | |
+ | fields in this struct
+ |
+help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields
+ |
+LL | struct MultipleUnused((), (), (), ());
+ | ~~ ~~ ~~ ~~
+
+error: aborting due to 2 previous errors
+