File tree 5 files changed +34
-3
lines changed
5 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,6 @@ impl<'tcx> ConstEvalErr<'tcx> {
141
141
err_inval ! ( Layout ( LayoutError :: Unknown ( _) ) ) |
142
142
err_inval ! ( TooGeneric ) =>
143
143
return Err ( ErrorHandled :: TooGeneric ) ,
144
- err_inval ! ( Layout ( LayoutError :: SizeOverflow ( _) ) ) |
145
144
err_inval ! ( TypeckError ) =>
146
145
return Err ( ErrorHandled :: Reported ) ,
147
146
_ => { } ,
Original file line number Diff line number Diff line change
1
+ // error-pattern: reaching this expression at runtime will panic or abort
2
+ fn main ( ) {
3
+ println ! ( "Size: {}" , std:: mem:: size_of:: <[ u8 ; std:: u64 :: MAX as usize ] >( ) ) ;
4
+ }
Original file line number Diff line number Diff line change
1
+ error: reaching this expression at runtime will panic or abort
2
+ --> $SRC_DIR/libcore/mem/mod.rs:LL:COL
3
+ |
4
+ LL | intrinsics::size_of::<T>()
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^ rustc layout computation failed: SizeOverflow([u8; 18446744073709551615])
6
+ |
7
+ ::: $DIR/issue-55878.rs:3:26
8
+ |
9
+ LL | println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
10
+ | ---------------------------------------------------
11
+ |
12
+ = note: `#[deny(const_err)]` on by default
13
+
14
+ error: aborting due to previous error
15
+
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ impl TooBigArray {
17
17
}
18
18
19
19
static MY_TOO_BIG_ARRAY_1 : TooBigArray = TooBigArray :: new ( ) ;
20
+ //~^ ERROR could not evaluate static initializer
20
21
static MY_TOO_BIG_ARRAY_2 : [ u8 ; HUGE_SIZE ] = [ 0x00 ; HUGE_SIZE ] ;
22
+ //~^ ERROR could not evaluate static initializer
21
23
22
24
fn main ( ) { }
Original file line number Diff line number Diff line change 1
- error: the type `[u8; 2305843009213693951]` is too big for the current architecture
1
+ error[E0080]: could not evaluate static initializer
2
+ --> $DIR/issue-56762.rs:19:1
3
+ |
4
+ LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new();
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustc layout computation failed: SizeOverflow([u8; 2305843009213693951])
2
6
3
- error: aborting due to previous error
7
+ error[E0080]: could not evaluate static initializer
8
+ --> $DIR/issue-56762.rs:21:1
9
+ |
10
+ LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE];
11
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ rustc layout computation failed: SizeOverflow([u8; 2305843009213693951])
4
12
13
+ error: aborting due to 2 previous errors
14
+
15
+ For more information about this error, try `rustc --explain E0080`.
You can’t perform that action at this time.
0 commit comments