-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-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) ❄️

Description
This code looks meaningless, but it's still valid code. However it can cause cargo
to panic.
// This file is: main.rs
fn main() {
let mut bytes = vec![];
bytes.append(&mut include_bytes!("main.rs").to_vec());
println!("Byte count: {}", bytes.len());
}
First build is ok. Then call shell touch main.rs
and build again, cargo
will crash with:
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 1',
/checkout/src/libcore/slice/mod.rs:2079:10
Version: cargo 1.28.0 (96a2c7d16 2018-07-13)
DutchGhost, est31 and Kerollmops
Metadata
Metadata
Assignees
Labels
A-incr-compArea: Incremental compilationArea: Incremental compilationC-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) ❄️