-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.
Description
Having huge data structures (larger than u64::MAX
) results in incorrect binaries being built.
I tried this code:
fn main() {
println!("Size: {}", std::mem::size_of::<[u8; std::u64::MAX as usize]>());
}
I expected this to happen: Output of Size: 18446744073709551616
, or a compiler error telling me the structure is too big
Instead, this happened: Binary compiled successfully, but running it results in Illegal instruction (core dumped)
Meta
rustc --version --verbose
rustc 1.32.0-nightly (6e9b84296 2018-11-10)
binary: rustc
commit-hash: 6e9b84296223126a0a59bde63a0f97011bb7b0f5
commit-date: 2018-11-10
host: x86_64-unknown-linux-gnu
release: 1.32.0-nightly
LLVM version: 8.0
zackmdavis, real-felix and jplattescottmcm and icefoxen
Metadata
Metadata
Assignees
Labels
A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.Category: This is a bug.