-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Always error on SizeOverflow
during mir evaluation
#63152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
83b5eb9
58bd878
d3da411
2c56842
db099fb
2340067
387dcff
bdd79b8
f621f89
ce8510a
613c0a8
64469ac
3144b0a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// error-pattern: reaching this expression at runtime will panic or abort | ||
fn main() { | ||
println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>()); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0080]: reaching this expression at runtime will panic or abort | ||
--> $SRC_DIR/libcore/mem/mod.rs:LL:COL | ||
| | ||
LL | intrinsics::size_of::<T>() | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `[u8; 18446744073709551615]` is too big for the current architecture | ||
|
||
| | ||
::: $DIR/issue-55878.rs:3:26 | ||
| | ||
LL | println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>()); | ||
| --------------------------------------------------- | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
error: the type `[u8; 2305843009213693951]` is too big for the current architecture | ||
error[E0080]: could not evaluate static initializer | ||
--> $DIR/issue-56762.rs:19:1 | ||
| | ||
LL | static MY_TOO_BIG_ARRAY_1: TooBigArray = TooBigArray::new(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `[u8; 2305843009213693951]` is too big for the current architecture | ||
|
||
error: aborting due to previous error | ||
error[E0080]: could not evaluate static initializer | ||
--> $DIR/issue-56762.rs:21:1 | ||
| | ||
LL | static MY_TOO_BIG_ARRAY_2: [u8; HUGE_SIZE] = [0x00; HUGE_SIZE]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the type `[u8; 2305843009213693951]` is too big for the current architecture | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0080`. |
Uh oh!
There was an error while loading. Please reload this page.