Closed jyn514 closed 1 year ago
+1, I've been getting these all the time when bootstrapping rust. Basically always have to ./x.py clean
before building after a nontrivial change.
I think this might be related to the the issues that @Aaron1011 was fixing like last month about incremental compilation bugs on nightly (e.g. #92534) but which aren't on beta yet, which we use to bootstrap?
@compiler-errors you can make it much faster to rebuild by running rm -r target/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/incremental/
instead of a full x.py clean
Maybe we could add a flag to x
to bootstrap with a custom compiler artifact, like nightly-2022-02-09
? Is that a bad idea? If not, I might look into it.
This is obviously a bandaid for when beta
is particularly ICE-prone, but maybe it could be useful for other things...
rustc = ... in config.toml is something that's already supported -- you can point it at a nightly toolchain and things should largely just work (presuming it's recent enough etc).
Closing as (a duplicate|resolved|a resolved duplicate).
Code
https://github.com/jyn514/rust/commit/0fa56d77280a959f6cd2a9c07942b8a3223dec1f with this diff applied:
Meta
rustc --version --verbose
:Error output
Backtrace
``` Building stage0 compiler artifacts (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu)) Compiling rustc_typeck v0.0.0 (/home/jnelson/rust-lang/rust/compiler/rustc_typeck) Compiling rustc_privacy v0.0.0 (/home/jnelson/rust-lang/rust/compiler/rustc_privacy) Compiling rustc_interface v0.0.0 (/home/jnelson/rust-lang/rust/compiler/rustc_interface) stack backtrace: 0: rust_begin_unwind at /rustc/28c8a34e18fc05277c81328d1bbf5ed931f4d22e/library/std/src/panicking.rs:498:5 1: core::panicking::panic_fmt at /rustc/28c8a34e18fc05277c81328d1bbf5ed931f4d22e/library/core/src/panicking.rs:107:14 2: core::panicking::panic_bounds_check at /rustc/28c8a34e18fc05277c81328d1bbf5ed931f4d22e/library/core/src/panicking.rs:75:5 3:>::decode
4: >::decode
5: ::read_seq::, as rustc_serialize::serialize::Decodable>::decode::{closure#0}>
6: >::decode
7: >::decode
8: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable>::decode
9: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable>::decode
10: as core::iter::traits::collect::Extend>::extend::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, alloc::string::String>>
11: core::iter::adapters::process_results::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, rustc_middle::ty::subst::GenericArg, alloc::string::String, , alloc::string::String> as core::iter::traits::collect::FromIterator>>::from_iter, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>>::{closure#0}, smallvec::SmallVec<[rustc_middle::ty::subst::GenericArg; 8]>>
12: as rustc_middle::ty::context::InternIteratorElement>>::intern_with::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, ::mk_substs, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>>::{closure#0}>
13: >::decode
14: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable>::decode
15: as core::iter::traits::collect::Extend>::extend::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, alloc::string::String>>
16: core::iter::adapters::process_results::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, rustc_middle::ty::subst::GenericArg, alloc::string::String, , alloc::string::String> as core::iter::traits::collect::FromIterator>>::from_iter, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>>::{closure#0}, smallvec::SmallVec<[rustc_middle::ty::subst::GenericArg; 8]>>
17: as rustc_middle::ty::context::InternIteratorElement>>::intern_with::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, ::mk_substs, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>>::{closure#0}>
18: >::decode
19: <&rustc_middle::ty::TyS as rustc_serialize::serialize::Decodable>::decode
20: as core::iter::traits::collect::Extend>::extend::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, alloc::string::String>>
21: core::iter::adapters::process_results::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, rustc_middle::ty::subst::GenericArg, alloc::string::String, , alloc::string::String> as core::iter::traits::collect::FromIterator>>::from_iter, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>>::{closure#0}, smallvec::SmallVec<[rustc_middle::ty::subst::GenericArg; 8]>>
22: ::mk_substs::, <&rustc_middle::ty::list::List as rustc_serialize::serialize::Decodable>::decode::{closure#0}>>
23: as rustc_serialize::serialize::Decodable>::decode
24: , rustc_errors::ErrorReported> as rustc_serialize::serialize::Decodable>::decode
25: ::try_load_query_result::, rustc_errors::ErrorReported>>
26: <>::TRY_LOAD_FROM_DISK::{closure#0} as core::ops::function::FnOnce<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::dep_graph::serialized::SerializedDepNodeIndex)>>::call_once
27: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::), core::result::Result, rustc_errors::ErrorReported>>
28: rustc_query_system::query::plumbing::try_execute_query::), core::result::Result, rustc_errors::ErrorReported>>>
29: ::codegen_fulfill_obligation
30: rustc_ty_utils::instance::inner_resolve_instance
31: rustc_ty_utils::instance::resolve_instance
32: rustc_query_system::query::plumbing::try_load_from_disk_and_cache_in_memory::)>, core::result::Result, rustc_errors::ErrorReported>>
33: rustc_query_system::query::plumbing::get_query::
34: ::resolve_instance
35: ::resolve
36: rustc_monomorphize::collector::collect_neighbours
37: rustc_monomorphize::collector::collect_items_rec
38: rustc_monomorphize::collector::collect_items_rec
39: rustc_monomorphize::collector::collect_items_rec
40: rustc_monomorphize::collector::collect_items_rec
41: rustc_monomorphize::collector::collect_items_rec
42: rustc_monomorphize::collector::collect_items_rec
43: rustc_monomorphize::collector::collect_items_rec
44: rustc_monomorphize::collector::collect_items_rec
45: rustc_monomorphize::collector::collect_items_rec
46: rustc_monomorphize::collector::collect_items_rec
47: rustc_monomorphize::collector::collect_items_rec
48: rustc_monomorphize::collector::collect_items_rec
49: rustc_monomorphize::collector::collect_items_rec
50: rustc_monomorphize::collector::collect_items_rec
51: rustc_monomorphize::collector::collect_items_rec
52: rustc_monomorphize::collector::collect_items_rec
53: rustc_monomorphize::collector::collect_items_rec
54: rustc_monomorphize::collector::collect_items_rec
55: rustc_monomorphize::collector::collect_items_rec
56: rustc_monomorphize::collector::collect_items_rec
57: rustc_monomorphize::collector::collect_items_rec
58: rustc_monomorphize::collector::collect_items_rec
59: rustc_monomorphize::collector::collect_items_rec
60: rustc_monomorphize::collector::collect_items_rec
61: rustc_monomorphize::collector::collect_items_rec
62: ::time::<(), rustc_monomorphize::collector::collect_crate_mono_items::{closure#1}>
63: rustc_monomorphize::collector::collect_crate_mono_items
64: rustc_monomorphize::partitioning::collect_and_partition_mono_items
65: ::with_deps::<>::with_task_impl>, &[rustc_middle::mir::mono::CodegenUnit])>::{closure#0}, (&std::collections::hash::set::HashSet>, &[rustc_middle::mir::mono::CodegenUnit])>
66: >::with_task::>, &[rustc_middle::mir::mono::CodegenUnit])>
67: rustc_data_structures::stack::ensure_sufficient_stack::<((&std::collections::hash::set::HashSet>, &[rustc_middle::mir::mono::CodegenUnit]), rustc_query_system::dep_graph::graph::DepNodeIndex), rustc_query_system::query::plumbing::execute_job>, &[rustc_middle::mir::mono::CodegenUnit])>::{closure#3}>
68: rustc_query_system::query::plumbing::try_execute_query::>, &[rustc_middle::mir::mono::CodegenUnit])>>
69: rustc_query_system::query::plumbing::get_query::
70: ::collect_and_partition_mono_items
71: ::codegen_crate
72: ::time::, rustc_interface::passes::start_codegen::{closure#0}>
73: ::ongoing_codegen
74: ::enter::, rustc_errors::ErrorReported>>
75: rustc_span::with_source_map::, rustc_interface::interface::create_compiler_and_run, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
76: rustc_interface::interface::create_compiler_and_run::, rustc_driver::run_compiler::{closure#1}>
77: >::set::, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_errors::ErrorReported>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.59.0-beta.5 (28c8a34e1 2022-01-27) running on x86_64-unknown-linux-gnu
note: compiler flags: -Z macro-backtrace -Z tls-model=initial-exec -Z unstable-options -Z binary-dep-depinfo -Z force-unstable-if-unmarked -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C incremental -C symbol-mangling-version=v0 -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C prefer-dynamic -C llvm-args=-import-instr-limit=10 --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [codegen_fulfill_obligation] checking if `core::ops::function::FnMut` fulfills its obligations
#1 [resolve_instance] resolving instance `<[closure@core::iter::adapters::copied::copy_try_fold, [closure@core::iter::traits::iterator::Iterator::try_for_each::call, [closure@rustc_middle::ty::subst::>::super_visit_with::{closure#0}]>::{closure#0}]>::{closure#0}] as core::ops::function::FnMut<((), &rustc_middle::ty::subst::GenericArg)>>::call_mut`
#2 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
error: could not compile `rustc_typeck`
```