Skip to content

Commit

Permalink
[fixup] bless all the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed Nov 26, 2023
1 parent d254a5f commit 0f05b27
Show file tree
Hide file tree
Showing 35 changed files with 1,203 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,19 @@ LL | #![feature(return_type_notation)]
= note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information
= note: `#[warn(incomplete_features)]` on by default

warning: 1 warning emitted
warning: field `0` is never read
--> $DIR/rtn-implied-in-supertrait.rs:9:22
|
LL | struct JoinHandle<T>(fn() -> T);
| ---------- ^^^^^^^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 JoinHandle<T>(());
| ~~

warning: 2 warnings emitted

68 changes: 67 additions & 1 deletion tests/ui/auto-traits/suspicious-impls-lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,71 @@ note: try using the same sequence of generic parameters as the struct definition
LL | pub struct WithLifetime<'a, T>(&'a (), T);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 5 previous errors
warning: field `0` is never read
--> $DIR/suspicious-impls-lint.rs:13:33
|
LL | struct ContainsNonSendDirect<T>(*const T);
| --------------------- ^^^^^^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 ContainsNonSendDirect<T>(());
| ~~

warning: field `0` is never read
--> $DIR/suspicious-impls-lint.rs:16:23
|
LL | struct ContainsPtr<T>(*const T);
| ----------- ^^^^^^^^
| |
| field in this struct
|
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 ContainsPtr<T>(());
| ~~

warning: field `0` is never read
--> $DIR/suspicious-impls-lint.rs:17:35
|
LL | struct ContainsIndirectNonSend<T>(ContainsPtr<T>);
| ----------------------- ^^^^^^^^^^^^^^
| |
| field in this struct
|
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 ContainsIndirectNonSend<T>(());
| ~~

warning: field `0` is never read
--> $DIR/suspicious-impls-lint.rs:20:23
|
LL | struct ContainsVec<T>(Vec<T>);
| ----------- ^^^^^^
| |
| field in this struct
|
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 ContainsVec<T>(());
| ~~

warning: field `0` is never read
--> $DIR/suspicious-impls-lint.rs:44:32
|
LL | pub struct WithLifetime<'a, T>(&'a (), T);
| ------------ ^^^^^^
| |
| field in this struct
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
LL | pub struct WithLifetime<'a, T>((), T);
| ~~

error: aborting due to 5 previous errors; 5 warnings emitted

29 changes: 28 additions & 1 deletion tests/ui/auto-traits/suspicious-negative-impls-lint.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,32 @@ note: try using the same sequence of generic parameters as the struct definition
LL | pub struct WithLifetime<'a, T>(&'a (), T);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors
warning: field `0` is never read
--> $DIR/suspicious-negative-impls-lint.rs:6:23
|
LL | struct ContainsVec<T>(Vec<T>);
| ----------- ^^^^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 ContainsVec<T>(());
| ~~

warning: field `0` is never read
--> $DIR/suspicious-negative-impls-lint.rs:16:32
|
LL | pub struct WithLifetime<'a, T>(&'a (), T);
| ------------ ^^^^^^
| |
| field in this struct
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
LL | pub struct WithLifetime<'a, T>((), T);
| ~~

error: aborting due to 3 previous errors; 2 warnings emitted

Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ fn test_sync_trait() {
}

/* Test Clone Trait Migration */
struct S(Foo);
struct S(());
struct T(i32);

struct U(S, T);
struct U((), T);

impl Clone for U {
fn clone(&self) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,32 @@ LL ~ let c = || {
LL + let _ = &f;
|

error: aborting due to 3 previous errors
warning: field `0` is never read
--> $DIR/auto_traits.rs:54:10
|
LL | struct S(Foo);
| - ^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 S(());
| ~~

warning: field `0` is never read
--> $DIR/auto_traits.rs:57:10
|
LL | struct U(S, T);
| - ^
| |
| field in this struct
|
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 U((), T);
| ~~

error: aborting due to 3 previous errors; 2 warnings emitted

16 changes: 15 additions & 1 deletion tests/ui/const-generics/issues/issue-85031-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,19 @@ LL | Self::foo()
= help: a `loop` may express intention better if this is on purpose
= note: `#[warn(unconditional_recursion)]` on by default

warning: 1 warning emitted
warning: field `0` is never read
--> $DIR/issue-85031-2.rs:9:20
|
LL | pub struct Ref<'a>(&'a i32);
| --- ^^^^^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
LL | pub struct Ref<'a>(());
| ~~

warning: 2 warnings emitted

16 changes: 15 additions & 1 deletion tests/ui/consts/const-eval/issue-50814.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
warning: field `0` is never read
--> $DIR/issue-50814.rs:7:11
|
LL | struct U8(u8);
| -- ^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 U8(());
| ~~

error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
--> $DIR/issue-50814.rs:15:21
|
Expand All @@ -16,6 +30,6 @@ note: the above error was encountered while instantiating `fn foo::<i32>`
LL | foo(0);
| ^^^^^^

error: aborting due to 1 previous error
error: aborting due to 1 previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0080`.
55 changes: 54 additions & 1 deletion tests/ui/consts/const-eval/raw-bytes.64bit.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,56 @@
warning: field `0` is never read
--> $DIR/raw-bytes.rs:64:25
|
LL | struct RestrictedRange1(u32);
| ---------------- ^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 RestrictedRange1(());
| ~~

warning: field `0` is never read
--> $DIR/raw-bytes.rs:70:25
|
LL | struct RestrictedRange2(u32);
| ---------------- ^^^
| |
| field in this struct
|
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 RestrictedRange2(());
| ~~

warning: field `0` is never read
--> $DIR/raw-bytes.rs:131:14
|
LL | struct MyStr(str);
| ----- ^^^
| |
| field in this struct
|
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 MyStr(());
| ~~

warning: field `0` is never read
--> $DIR/raw-bytes.rs:134:27
|
LL | struct MySlice<T: ?Sized>(bool, T);
| ------- ^^^^
| |
| field in this struct
|
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 MySlice<T: ?Sized>((), T);
| ~~

error[E0080]: it is undefined behavior to use this value
--> $DIR/raw-bytes.rs:20:1
|
Expand Down Expand Up @@ -594,6 +647,6 @@ LL | pub static R6: &[bool] = unsafe {
╾ALLOC_ID╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
}

error: aborting due to 52 previous errors
error: aborting due to 52 previous errors; 4 warnings emitted

For more information about this error, try `rustc --explain E0080`.
17 changes: 16 additions & 1 deletion tests/ui/consts/const-eval/ub-incorrect-vtable.64bit.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
warning: fields `0` and `1` are never read
--> $DIR/ub-incorrect-vtable.rs:52:17
|
LL | struct Wide<'a>(&'a Foo, &'static VTable);
| ---- ^^^^^^^ ^^^^^^^^^^^^^^^
| |
| fields in this struct
|
= note: `Wide` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 Wide<'a>((), ());
| ~~ ~~

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-incorrect-vtable.rs:18:1
|
Expand Down Expand Up @@ -64,6 +79,6 @@ LL | const G: Wide = unsafe { Transmute { t: FOO }.u };
╾ALLOC10╼ ╾ALLOC11╼ │ ╾──────╼╾──────╼
}

error: aborting due to 6 previous errors
error: aborting due to 6 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0080`.
29 changes: 28 additions & 1 deletion tests/ui/consts/const-eval/ub-nonnull.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
warning: field `0` is never read
--> $DIR/ub-nonnull.rs:42:25
|
LL | struct RestrictedRange1(u32);
| ---------------- ^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 RestrictedRange1(());
| ~~

warning: field `0` is never read
--> $DIR/ub-nonnull.rs:48:25
|
LL | struct RestrictedRange2(u32);
| ---------------- ^^^
| |
| field in this struct
|
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 RestrictedRange2(());
| ~~

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-nonnull.rs:14:1
|
Expand Down Expand Up @@ -76,6 +103,6 @@ LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
HEX_DUMP
}

error: aborting due to 8 previous errors
error: aborting due to 8 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0080`.
29 changes: 28 additions & 1 deletion tests/ui/consts/const-eval/ub-wide-ptr.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
warning: field `0` is never read
--> $DIR/ub-wide-ptr.rs:28:14
|
LL | struct MyStr(str);
| ----- ^^^
| |
| field in this struct
|
= note: `#[warn(unused_tuple_struct_fields)]` on by default
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 MyStr(());
| ~~

warning: field `0` is never read
--> $DIR/ub-wide-ptr.rs:31:27
|
LL | struct MySlice<T: ?Sized>(bool, T);
| ------- ^^^^
| |
| field in this struct
|
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 MySlice<T: ?Sized>((), T);
| ~~

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-wide-ptr.rs:38:1
|
Expand Down Expand Up @@ -317,6 +344,6 @@ LL | static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = uns
HEX_DUMP
}

error: aborting due to 29 previous errors
error: aborting due to 29 previous errors; 2 warnings emitted

For more information about this error, try `rustc --explain E0080`.
Loading

0 comments on commit 0f05b27

Please sign in to comment.