Closed
Description
Hello,
this simple code returns an ICE with cargo run:
enum TokenType {
}
#[derive(Clone, Copy)]
struct Position {
column: u64,
line: u64
}
struct Token {
position: Position,
type_: TokenType,
value: String
}
fn main() {
}
This is the backtrace:
error: internal compiler error: src/librustc/dep_graph/graph.rs:680: DepNode Hir(nitor_scheme[e747]::Token[0]::value[0]) should have been pre-allocated but wasn't.
thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:931:9
stack backtrace:
0: 0x7f0695515b24 - backtrace::backtrace::libunwind::trace::h65597d255cb1398b
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/libunwind.rs:88
1: 0x7f0695515b24 - backtrace::backtrace::trace_unsynchronized::hd4f479d7150ec4a0
at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.40/src/backtrace/mod.rs:66
2: 0x7f0695515b24 - std::sys_common::backtrace::_print_fmt::h015072984a2b172c
at src/libstd/sys_common/backtrace.rs:77
3: 0x7f0695515b24 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h6df05d3335f32194
at src/libstd/sys_common/backtrace.rs:61
4: 0x7f069554e45c - core::fmt::write::h1f444f4312eb6c27
at src/libcore/fmt/mod.rs:1028
5: 0x7f0695509f07 - std::io::Write::write_fmt::h8d147888220078ef
at src/libstd/io/mod.rs:1412
6: 0x7f069551a38e - std::sys_common::backtrace::_print::h8a6df0fa81d6af62
at src/libstd/sys_common/backtrace.rs:65
7: 0x7f069551a38e - std::sys_common::backtrace::print::h6f05b4733407e509
at src/libstd/sys_common/backtrace.rs:50
8: 0x7f069551a38e - std::panicking::default_hook::{{closure}}::h0d0a23bd02315dd8
at src/libstd/panicking.rs:188
9: 0x7f069551a081 - std::panicking::default_hook::h8d15a9aecb4efac6
at src/libstd/panicking.rs:205
10: 0x7f06959fb853 - rustc_driver::report_ice::h604244c68c1c9a3a
11: 0x7f069551ab60 - std::panicking::rust_panic_with_hook::hbe174577402a475d
at src/libstd/panicking.rs:468
12: 0x7f069788411d - std::panicking::begin_panic::h58bba5e152fa0bee
13: 0x7f06978b8473 - rustc_errors::HandlerInner::bug::h7438b1481ec83686
14: 0x7f06978b733a - rustc_errors::Handler::bug::h4011e86e57f14226
15: 0x7f06971000d3 - rustc::util::bug::opt_span_bug_fmt::{{closure}}::hb274b8a1780df2dc
16: 0x7f06970fd793 - rustc::ty::context::tls::with_opt::{{closure}}::h7a7e5562232b0149
17: 0x7f06970fd703 - rustc::ty::context::tls::with_context_opt::h525375971cd1d6ed
18: 0x7f06970fd747 - rustc::ty::context::tls::with_opt::h3f94bd5c689d4af2
19: 0x7f06970fffe8 - rustc::util::bug::opt_span_bug_fmt::h5637bf03a92b95d0
20: 0x7f06970fff52 - rustc::util::bug::bug_fmt::hfb79a0bf2b371fa1
21: 0x7f06970aa62e - rustc::dep_graph::graph::DepGraph::try_mark_previous_green::h74a25b2962b19d8f
22: 0x7f06970a9ee1 - rustc::dep_graph::graph::DepGraph::try_mark_green::h783cf10326639eb8
23: 0x7f06970a9d5d - rustc::dep_graph::graph::DepGraph::try_mark_green_and_read::h088e27bf030f5a81
24: 0x7f0696102fbd - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::haa291ed7fecfadf5
25: 0x7f06961b244c - <rustc_typeck::outlives::implicit_infer::InferVisitor as rustc::hir::itemlikevisit::ItemLikeVisitor>::visit_item::h46947760d3b16f49
26: 0x7f06961cdf09 - rustc::hir::Crate::visit_all_item_likes::hee5ce7b527af9397
27: 0x7f06961da92f - rustc_typeck::outlives::inferred_outlives_crate::h84380a3c7dac5826
28: 0x7f0695fe91e5 - rustc::ty::query::__query_compute::inferred_outlives_crate::h32257f22e659aa48
29: 0x7f06960378ec - rustc::dep_graph::graph::DepGraph::with_task_impl::h57be74ef47de7e30
30: 0x7f06960c4b0b - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h0ad054575a564b37
31: 0x7f06961da4e4 - rustc_typeck::outlives::inferred_outlives_of::h4ecb649ed041f96b
32: 0x7f0695fe8a5a - rustc::ty::query::__query_compute::inferred_outlives_of::h26400f5a0cd8a817
33: 0x7f06960b340b - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::inferred_outlives_of>::compute::h12dab411960a0d54
34: 0x7f0696035324 - rustc::dep_graph::graph::DepGraph::with_task_impl::h3eb481da3650be8d
35: 0x7f06960dc184 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h4db42ec3df58ac35
36: 0x7f06960a4897 - rustc_typeck::collect::predicates_defined_on::h590325cb0b3d7229
37: 0x7f0695fe8c12 - rustc::ty::query::__query_compute::predicates_defined_on::h67ad5fec3c426f82
38: 0x7f06960b343c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::predicates_defined_on>::compute::heec42bde4eece152
39: 0x7f069603a591 - rustc::dep_graph::graph::DepGraph::with_task_impl::h85e1073e233e91a4
40: 0x7f0696106eff - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hafc10a5a79999f86
41: 0x7f06960a4b29 - rustc_typeck::collect::predicates_of::h42293ade3b8b48d1
42: 0x7f0695fe754f - rustc::ty::query::__query_compute::predicates_of::h2471f2a7bf3fae84
43: 0x7f06960b310c - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::predicates_of>::compute::hfe607691855e423c
44: 0x7f069603d5a1 - rustc::dep_graph::graph::DepGraph::with_task_impl::hb30b8b10acd5c5ac
45: 0x7f06960d302d - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h3e57daecd1133c5f
46: 0x7f069609bfc0 - <rustc_typeck::collect::CollectItemTypesVisitor as rustc::hir::intravisit::Visitor>::visit_item::h6b6ec407b14bfe3f
47: 0x7f0696013213 - rustc::hir::map::Map::visit_item_likes_in_module::h4c4aa1fa526963f4
48: 0x7f069609bc14 - rustc_typeck::collect::collect_mod_item_types::h34811f2e4b252d4a
49: 0x7f0695fe8eda - rustc::ty::query::__query_compute::collect_mod_item_types::heac1873a1e411c55
50: 0x7f06960b34bb - rustc::ty::query::<impl rustc::ty::query::config::QueryAccessors for rustc::ty::query::queries::collect_mod_item_types>::compute::h6ca5ef9ca4bcc3cd
51: 0x7f0696040257 - rustc::dep_graph::graph::DepGraph::with_task_impl::hc5b3fca2a6918254
52: 0x7f0696111ec0 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::hd4708da89736dc71
53: 0x7f06960b3c95 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::ensure_query::hf66c67084d9786e3
54: 0x7f06961b3059 - rustc_typeck::check_crate::{{closure}}::{{closure}}::ha0485b0a17522e83
55: 0x7f069619cc86 - rustc::util::common::time::hf116161cfd242531
56: 0x7f06961dc19d - rustc_typeck::check_crate::hcef2c601ae2b67e5
57: 0x7f0695adeb04 - rustc_interface::passes::analysis::h77fd894da5badde0
58: 0x7f0695a69481 - rustc::ty::query::__query_compute::analysis::h39e6fd766157b8c8
59: 0x7f0695a6bd39 - rustc::dep_graph::graph::DepGraph::with_task_impl::h7d50a3684e7e1a75
60: 0x7f06959e3f56 - rustc::ty::query::plumbing::<impl rustc::ty::context::TyCtxt>::get_query::h8792deed72f3c814
61: 0x7f0695a6ea3a - rustc_interface::passes::BoxedGlobalCtxt::access::{{closure}}::h13f9e1b0bf2386ce
62: 0x7f0695b3092a - rustc_interface::passes::create_global_ctxt::{{closure}}::h3f8b716b6851e054
63: 0x7f0695a6e78e - rustc_interface::passes::BoxedGlobalCtxt::enter::h710e6729620e7fd4
64: 0x7f0695a3e7c7 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h0a60318490fa2acb
65: 0x7f0695a1f112 - std::thread::local::LocalKey<T>::with::h6fe64a0878c37a25
66: 0x7f0695a1cbce - scoped_tls::ScopedKey<T>::set::h7c068b51568535e7
67: 0x7f0695a4b264 - syntax::with_globals::heb0c291b2ded5098
68: 0x7f0695a638d0 - std::sys_common::backtrace::__rust_begin_short_backtrace::h0dd3117452872c48
69: 0x7f069552b44a - __rust_maybe_catch_panic
at src/libpanic_unwind/lib.rs:78
70: 0x7f0695a64809 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hb67c6244c5ee6f29
71: 0x7f06954fbe2f - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h3534c64212330b0c
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/liballoc/boxed.rs:942
72: 0x7f0695529e70 - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h338c10574a337ece
at /rustc/73528e339aae0f17a15ffa49a8ac608f50c6cf14/src/liballoc/boxed.rs:942
73: 0x7f0695529e70 - std::sys_common::thread::start_thread::h761ac6d57710d65d
at src/libstd/sys_common/thread.rs:13
74: 0x7f0695529e70 - std::sys::unix::thread::Thread::new::thread_start::h61c012ef60f933c0
at src/libstd/sys/unix/thread.rs:79
75: 0x7f06952962de - start_thread
76: 0x7f0694bba133 - __GI___clone
77: 0x0 - <unknown>
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.40.0 (73528e339 2019-12-16) running on x86_64-unknown-linux-gnu
note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [type_of] processing `Token::value`
#1 [inferred_outlives_crate] computing the inferred outlives predicates for items in this crate
#2 [inferred_outlives_of] processing `TokenType`
#3 [predicates_defined_on] processing `TokenType`
#4 [predicates_of] processing `TokenType`
#5 [collect_mod_item_types] collecting item types in top-level module
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
Area: Type systemCategory: This is a bug.Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️High priorityRelevant to the compiler team, which will review and decide on the PR/issue.