Skip to content

Commit f12a0b4

Browse files
committed
check both instances of invalid Align seperately
1 parent 3d86793 commit f12a0b4

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// test that invalid alignments put into Align fail
2-
//~? ERROR unknown layout
1+
// test that invalid alignments put into Align fail\
32
#![feature(align_type)]
43

54
use std::mem::Align;
@@ -8,10 +7,12 @@ const MAX_SUPPORTED_ALIGN: usize = 1 << 29;
87

98
const _: () = {
109
// not power of two
11-
align_of::<Align<3>>();
10+
align_of::<Align<3>>(); //~? ERROR unknown layout
11+
};
1212

13+
const _: () = {
1314
// too big
14-
align_of::<Align<{MAX_SUPPORTED_ALIGN * 2}>>();
15+
align_of::<Align<{MAX_SUPPORTED_ALIGN * 2}>>(); //~? ERROR unknown layout
1516
};
1617

1718
fn main() {}

tests/ui/layout/align-type/invalid-alignment.stderr

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ error[E0080]: the type `Align<3>` has an unknown layout
33
|
44
= note: evaluation of `<std::mem::Align<3> as std::mem::SizedTypeProperties>::ALIGN` failed here
55

6-
error: aborting due to 1 previous error
6+
error[E0080]: the type `Align<1073741824>` has an unknown layout
7+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
8+
|
9+
= note: evaluation of `<std::mem::Align<1073741824> as std::mem::SizedTypeProperties>::ALIGN` failed here
10+
11+
error: aborting due to 2 previous errors
712

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

0 commit comments

Comments
 (0)