File tree Expand file tree Collapse file tree 5 files changed +34
-3
lines changed Expand file tree Collapse file tree 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> {
141141 err_inval ! ( Layout ( LayoutError :: Unknown ( _) ) ) |
142142 err_inval ! ( TooGeneric ) =>
143143 return Err ( ErrorHandled :: TooGeneric ) ,
144- err_inval ! ( Layout ( LayoutError :: SizeOverflow ( _) ) ) |
145144 err_inval ! ( TypeckError ) =>
146145 return Err ( ErrorHandled :: Reported ) ,
147146 _ => { } ,
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 {
1717}
1818
1919static MY_TOO_BIG_ARRAY_1 : TooBigArray = TooBigArray :: new ( ) ;
20+ //~^ ERROR could not evaluate static initializer
2021static MY_TOO_BIG_ARRAY_2 : [ u8 ; HUGE_SIZE ] = [ 0x00 ; HUGE_SIZE ] ;
22+ //~^ ERROR could not evaluate static initializer
2123
2224fn 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])
26
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])
412
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