-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
When I test this program with cargo test
:
struct Bar(Vec<u8>);
impl Bar {
fn new(values: &[u8]) -> Self {
Bar(values.into())
}
fn get(&self, index: usize) -> u8 {
self.0[index]
}
}
#[test]
fn test() {
let foo = Bar::new(&[0u8; 4294967295]);
assert_eq!(foo.get(1), 0);
}
fn main() {
println!("hello world");
}
I got this:
C:\...\test>cargo test
Compiling foo v0.1.0 (file:///C:/.../test)
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: rustc 1.23.0-nightly (d6b06c63a 2017-11-09) running on i686-pc-windows-gnu
thread 'rustc' panicked at 'capacity overflow', src\libcore\option.rs:839:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: Could not compile `foo`.
To learn more, run the command again with --verbose.
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.