Closed
Description
I'm running into an issue with incremental compilation where compiling the below code and then compiling it again with the #[serde(tag = "variant")]
tag removed causes an ICE (it also fails if the steps are reversed i.e. compile first without and then with the attribute).
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
#[derive(Deserialize)]
#[serde(tag = "variant")] // if this attribute is added or removed after an incr comp build it causes an ICE
enum A {
A1 { x: usize },
}
fn main() {
// The below line also seems necessary to trigger the ICE
let a: A = serde_json::from_str("").unwrap();
}
And the backtrace from the compiler:
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/libcore/option.rs:323
stack backtrace:
1: 0x10fa145ec - std::sys::imp::backtrace::tracing::imp::write::hf587afb8e94ad165
2: 0x10fa2104e - std::panicking::default_hook::{{closure}}::haf3443cb412055ce
3: 0x10fa20bf3 - std::panicking::default_hook::h742f925bfab3bbfa
4: 0x10fa21507 - std::panicking::rust_panic_with_hook::h6f06ff8d28a94df6
5: 0x10fa213b4 - std::panicking::begin_panic::h7b9167ba3324cfae
6: 0x10fa212d2 - std::panicking::begin_panic_fmt::hb5f8f1fe0fe23e28
7: 0x10fa21237 - rust_begin_unwind
8: 0x10fa5ee40 - core::panicking::panic_fmt::he6eb92dab4407c61
9: 0x10fa5ed44 - core::panicking::panic::h16db271caf2c9025
10: 0x10aeba3e1 - rustc_incremental::persist::load::decode_dep_graph::hd9a1e8a507634d7f
11: 0x10aeb0c8f - rustc_incremental::persist::load::load_dep_graph::h5f726d61d7f24d69
12: 0x10aa1301a - rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::h46c275184428de94
13: 0x10aa065da - rustc_driver::driver::phase_3_run_analysis_passes::h9f46d8470c4871d9
14: 0x10a9f5ba0 - rustc_driver::driver::compile_input::h550b23c65a0bc968
15: 0x10aa3d24e - rustc_driver::run_compiler::h65867e99dfb91e54
16: 0x10a9550d8 - std::panicking::try::do_call::hdfa57184047b194c
17: 0x10fa2411a - __rust_maybe_catch_panic
18: 0x10a97db33 - <F as alloc::boxed::FnBox<A>>::call_box::h7af5270adbc74627
19: 0x10fa20174 - std::sys::imp::thread::Thread::new::thread_start::h4ad0b40513420e9c
20: 0x7fff89ee799c - _pthread_body
21: 0x7fff89ee7919 - _pthread_start
I'm running rustc 1.17.0-nightly (c49d10207 2017-02-07)
and cargo-0.18.0-nightly (de2919f 2017-02-06)
on OS X 10.11.6