Closed
Description
I experienced the following trying to compile a crate with rustc 1.32.0-nightly (0c999ed 2018-12-03).
I put up a copy of the code in the state that caused this at neosmart/securestore-rs@rustc_crash.
thread 'rustc' panicked at 'index out of bounds: the len is 1 but the index is 1', /rustc/0c999ed132d67bf2520643e9bd619972cf3888ba/src/libcore/slice/mod.rs:2463:10
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: internal compiler error: cat_expr Errd
--> securestore/src/lib.rs:76:87
|
76 | fn extract_keys(&self, iv: &Option<[u8; shared::IV_SIZE]>) -> Result<Keys, Error> {
| _______________________________________________________________________________________^
77 | | let mut encryption_key = [0u8; shared::KEY_LENGTH];
78 | | let mut hmac_key = [0u8; shared::KEY_LENGTH];
79 | |
... |
117 | | })
118 | | }
| |_____^
error: internal compiler error: cat_expr Errd
--> securestore/src/lib.rs:80:15
|
80 | match &Self {
| ^^^^^
error: internal compiler error: cat_expr Errd
--> securestore/src/lib.rs:80:16
|
80 | match &Self {
| ^^^^
error: internal compiler error: QualifyAndPromoteConstants: Mir had errors
--> securestore/src/lib.rs:76:5
|
76 | / fn extract_keys(&self, iv: &Option<[u8; shared::IV_SIZE]>) -> Result<Keys, Error> {
77 | | let mut encryption_key = [0u8; shared::KEY_LENGTH];
78 | | let mut hmac_key = [0u8; shared::KEY_LENGTH];
79 | |
... |
117 | | })
118 | | }
| |_____^
error: internal compiler error: broken MIR in DefId(0/0:54 ~ securestore[d33c]::{{impl}}[1]::extract_keys[0]) ("return type"): bad type [type error]
--> securestore/src/lib.rs:76:5
|
76 | / fn extract_keys(&self, iv: &Option<[u8; shared::IV_SIZE]>) -> Result<Keys, Error> {
77 | | let mut encryption_key = [0u8; shared::KEY_LENGTH];
78 | | let mut hmac_key = [0u8; shared::KEY_LENGTH];
79 | |
... |
117 | | })
118 | | }
| |_____^
error: internal compiler error: broken MIR in DefId(0/0:54 ~ securestore[d33c]::{{impl}}[1]::extract_keys[0]) (LocalDecl { mutability: Mut, is_user_variable: None, internal: false, is_block_tail: None, ty: [type error], user_ty: UserTypeProjections { contents: [] }, name: None, source_info: SourceInfo { span: securestore/src/lib.rs:76:5: 118:6, scope: scope[0] }, visibility_scope: scope[0] }): bad type [type error]
--> securestore/src/lib.rs:76:5
|
76 | / fn extract_keys(&self, iv: &Option<[u8; shared::IV_SIZE]>) -> Result<Keys, Error> {
77 | | let mut encryption_key = [0u8; shared::KEY_LENGTH];
78 | | let mut hmac_key = [0u8; shared::KEY_LENGTH];
79 | |
... |
117 | | })
118 | | }
| |_____^
thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:334:17
stack backtrace:
0: 0x7fe8be6d5c63 - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::h8c27c4880bde890a
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: 0x7fe8be6cd378 - std::sys_common::backtrace::_print::h94ad143e1a1f23ce
at src/libstd/sys_common/backtrace.rs:71
2: 0x7fe8be6d26d2 - std::panicking::default_hook::{{closure}}::he4263dcd9a70a0a9
at src/libstd/sys_common/backtrace.rs:59
at src/libstd/panicking.rs:211
3: 0x7fe8be6d243d - std::panicking::default_hook::he81ae3ee90693fac
at src/libstd/panicking.rs:227
4: 0x7fe8baea7cd3 - rustc::util::common::panic_hook::h6ff7d65005b5c4d4
5: 0x7fe8be6d2eb9 - std::panicking::rust_panic_with_hook::h0031c4eeabc83ca7
at src/libstd/panicking.rs:495
6: 0x7fe8b9aee744 - std::panicking::begin_panic::hf7a210e797c2ef35
7: 0x7fe8b9b00cb4 - <rustc_errors::Handler as core::ops::drop::Drop>::drop::h80f0d43cd8b57bf2
8: 0x7fe8beab4711 - core::ptr::real_drop_in_place::ha1ba247982bc728d
9: 0x7fe8beabac34 - rustc_driver::run_compiler_with_pool::h6807732b01150746
10: 0x7fe8be9f5aa5 - <scoped_tls::ScopedKey<T>>::set::hde11c7bf316bfff6
11: 0x7fe8beab91ea - rustc_driver::run_compiler::h2dda64ccf7980290
12: 0x7fe8bea136de - rustc_driver::monitor::{{closure}}::h54c6ce747624f597
13: 0x7fe8be6ef2e9 - __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:102
14: 0x7fe8bea04070 - <F as alloc::boxed::FnBox<A>>::call_box::h1b30e7f5bf58f422
15: 0x7fe8be6e280d - std::sys::unix::thread::Thread::new::thread_start::h9ba17bb7e4aabdcb
at /rustc/0c999ed132d67bf2520643e9bd619972cf3888ba/src/liballoc/boxed.rs:683
at src/libstd/sys_common/thread.rs:24
at src/libstd/sys/unix/thread.rs:90
16: 0x7fe8b8ad76da - start_thread
17: 0x7fe8be39188e - __clone
18: 0x0 - <unknown>
thread panicked while panicking. aborting.
error: Could not compile `securestore`.
Caused by:
process didn't exit successfully: `rustc --edition=2018 --crate-name securestore securestore/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=0749cce87946a744 -C extra-filename=-0749cce87946a744 --out-dir /mnt/d/GIT/securestore-rs/target/debug/deps -C incremental=/mnt/d/GIT/securestore-rs/target/debug/incremental -L dependency=/mnt/d/GIT/securestore-rs/target/debug/deps --extern openssl=/mnt/d/GIT/securestore-rs/target/debug/deps/libopenssl-2e68a25d4040a661.rlib --extern serde=/mnt/d/GIT/securestore-rs/target/debug/deps/libserde-40d2f6e887424bea.rlib --extern serde_derive=/mnt/d/GIT/securestore-rs/target/debug/deps/libserde_derive-f6d311be5ca0118f.so --extern serde_json=/mnt/d/GIT/securestore-rs/target/debug/deps/libserde_json-e41670aa8ec886a9.rlib -C target-cpu=native -C target-feature=+avx2` (signal: 4, SIGILL: illegal instruction)