Skip to content

Commit b12aeeb

Browse files
Fix tests in tests/ui/layout
Signed-off-by: FedericoBruzzone <[email protected]>
1 parent 16b9bb7 commit b12aeeb

6 files changed

+37
-7
lines changed

tests/ui/layout/base-layout-is-sized-ice-123078.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ LL | const C: S = unsafe { std::mem::transmute(()) };
2323
| ^^^^^^^^^^^^^^^^^^^
2424
|
2525
= note: source type: `()` (0 bits)
26-
= note: target type: `S` (size can vary because of [u8])
26+
= note: target type: `S` (this type does not have a fixed size)
2727

2828
error: aborting due to 2 previous errors
2929

tests/ui/layout/invalid-unsized-const-eval.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ struct LazyLock {
1010
}
1111

1212
static EMPTY_SET: LazyLock = todo!();
13+
//~^ ERROR could not evaluate static initializer
1314

1415
fn main() {}

tests/ui/layout/invalid-unsized-const-eval.stderr

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ LL | data: (dyn Sync, ()),
77
= help: the trait `Sized` is not implemented for `(dyn Sync + 'static)`
88
= note: only the last element of a tuple may have a dynamically sized type
99

10-
error: aborting due to 1 previous error
10+
error[E0080]: could not evaluate static initializer
11+
--> $DIR/invalid-unsized-const-eval.rs:12:1
12+
|
13+
LL | static EMPTY_SET: LazyLock = todo!();
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `(dyn Sync, ())` has an unknown layout
15+
16+
error: aborting due to 2 previous errors
1117

12-
For more information about this error, try `rustc --explain E0277`.
18+
Some errors have detailed explanations: E0080, E0277.
19+
For more information about an error, try `rustc --explain E0080`.

tests/ui/layout/invalid-unsized-in-always-sized-tail.stderr

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ LL | struct MySlice<T>(T);
1818
| |
1919
| this could be changed to `T: ?Sized`...
2020

21-
error: aborting due to 1 previous error
21+
error[E0080]: could not evaluate static initializer
22+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
23+
|
24+
= note: the type `MySlice<[bool]>` has an unknown layout
25+
|
26+
note: inside `align_of::<P2>`
27+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
28+
note: inside `CHECK`
29+
--> $DIR/invalid-unsized-in-always-sized-tail.rs:15:28
30+
|
31+
LL | static CHECK: () = assert!(align_of::<P2>() == 1);
32+
| ^^^^^^^^^^^^^^^^
33+
34+
error: aborting due to 2 previous errors
2235

23-
For more information about this error, try `rustc --explain E0277`.
36+
Some errors have detailed explanations: E0080, E0277.
37+
For more information about an error, try `rustc --explain E0080`.

tests/ui/layout/issue-unsized-tail-restatic-ice-122488.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ struct ArenaSet<U: Deref, V: ?Sized = <U as Deref>::Target>(V, U);
66
//~^ ERROR the size for values of type `V` cannot be known at compilation time
77

88
const DATA: *const ArenaSet<Vec<u8>> = std::ptr::null_mut();
9+
//~^ ERROR evaluation of constant value failed
910

1011
pub fn main() {}

tests/ui/layout/issue-unsized-tail-restatic-ice-122488.stderr

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ help: the `Box` type always has a statically known size and allocates its conten
2222
LL | struct ArenaSet<U: Deref, V: ?Sized = <U as Deref>::Target>(Box<V>, U);
2323
| ++++ +
2424

25-
error: aborting due to 1 previous error
25+
error[E0080]: evaluation of constant value failed
26+
--> $DIR/issue-unsized-tail-restatic-ice-122488.rs:8:1
27+
|
28+
LL | const DATA: *const ArenaSet<Vec<u8>> = std::ptr::null_mut();
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `ArenaSet<Vec<u8>, [u8]>` has an unknown layout
30+
31+
error: aborting due to 2 previous errors
2632

27-
For more information about this error, try `rustc --explain E0277`.
33+
Some errors have detailed explanations: E0080, E0277.
34+
For more information about an error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)