Closed
Description
I get Segmentation Fault on this code when running the debug binary.
Only happens on OS X Yosemite 10.10.5 .
fn main() {
let x = [1];
println!("{}", x[1]);
}
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
Running `target/debug/segfault`
Segmentation fault: 11
$ cargo run --release
Finished release [optimized] target(s) in 0.02s
Running `target/release/segfault`
thread 'main' panicked at 'index out of bounds: the len is 1 but the index is 1', src/main.rs:3:20
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Meta
rustc 1.27.0 (3eda71b 2018-06-19)
binary: rustc
commit-hash: 3eda71b
commit-date: 2018-06-19
host: x86_64-apple-darwin
release: 1.27.0
LLVM version: 6.0