Closed
Description
Building cargo
on Windows (-msvc
toolchain) causes an ICE:
PS D:\code\cargo> cargo +nightly build
Compiling cargo v0.58.0 (D:\code\cargo)
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/1f12ac87296ac61ec002e0243e7ad5a50364da35\compiler\rustc_middle\src\ty\sty.rs:974:9
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.58.0-nightly (1f12ac872 2021-10-17) running on x86_64-pc-windows-msvc
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [is_sized_raw] computing whether `dyn core::ops::function::Fn() -> core::result::Result<alloc::string::String, anyhow::Error>` is `Sized`
#1 [layout_of] computing layout of `&dyn core::ops::function::Fn() -> core::result::Result<alloc::string::String, anyhow::Error>`
#2 [layout_of] computing layout of `core::option::Option<&dyn core::ops::function::Fn() -> core::result::Result<alloc::string::String, anyhow::Error>>`
end of query stack
error: could not compile `cargo`
backtrace
0: 0x7ffab9588dbf - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4287336b592e4e30
1: 0x7ffab95b2a7a - core::fmt::write::h8a2c40ddb66ccc71
2: 0x7ffab957b5b8 - <std::io::IoSliceMut as core::fmt::Debug>::fmt::hd15f09e3fd3eac54
3: 0x7ffab958c516 - std::panicking::take_hook::hf14c76592f73c762
4: 0x7ffab958bffc - std::panicking::take_hook::hf14c76592f73c762
5: 0x7ffaa1f34bc5 - <sha2::sha512::Sha512 as std::io::Write>::flush::hfbd4e6352ea32e72
6: 0x7ffab958ce29 - std::panicking::rust_panic_with_hook::hbc0e9c80ca88eac0
7: 0x7ffab958c89f - rust_begin_unwind
8: 0x7ffab95896f7 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h4287336b592e4e30
9: 0x7ffab958c829 - rust_begin_unwind
10: 0x7ffab95e8e00 - core::panicking::panic_fmt::hc1b1ca620e7a2c9f
11: 0x7ffab95e8d4c - core::panicking::panic::hfef5cee9afdef02a
12: 0x7ffaa626d281 - rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions::h1076fbba22e024ff
13: 0x7ffaa4b01bb2 - rustc_ty_utils::instance::provide::he787bdc6bcc086b9
14: 0x7ffaa4b082b5 - rustc_ty_utils::provide::hbf06a6f4d9a37682
15: 0x7ffaa571742f - ZN16rustc_query_impl13on_disk_cache260_$LT$impl$u20$rustc_serialize..serialize..Decodable$LT$rustc_query_impl..on_disk_cache..CacheDecoder$GT$$u20$for$u20$$RF$std..collections..hash..set..HashSet$LT$rustc_span..def_id..LocalDefId$C$core..hash..BuildHasher
16: 0x7ffaa5795e40 - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green::hd5d86015fdc5f141
17: 0x7ffaa56dc4c8 - <rustc_span::def_id::DefIndex as rustc_query_impl::profiling_support::SpecIntoSelfProfilingString>::spec_to_self_profile_string::h385a8e115e139384
18: 0x7ffaa547c096 - <rustc_mir_dataflow::framework::cursor::CursorPosition as core::fmt::Debug>::fmt::h758f734727003b57
19: 0x7ffaa561ce2c - <rustc_mir_dataflow::framework::cursor::CursorPosition as core::fmt::Debug>::fmt::h758f734727003b57
20: 0x7ffaa652bf97 - rustc_middle::ty::util::<impl rustc_middle::ty::TyS>::is_sized::hcaf48fa9ca01af0a
21: 0x7ffaa651de99 - <rustc_middle::ty::layout::LayoutError as core::fmt::Display>::fmt::h5d0eaaff4515cbd2
22: 0x7ffaa6519d0d - <rustc_middle::ty::layout::LayoutError as core::fmt::Display>::fmt::h5d0eaaff4515cbd2
23: 0x7ffaa571048f - ZN16rustc_query_impl13on_disk_cache260_$LT$impl$u20$rustc_serialize..serialize..Decodable$LT$rustc_query_impl..on_disk_cache..CacheDecoder$GT$$u20$for$u20$$RF$std..collections..hash..set..HashSet$LT$rustc_span..def_id..LocalDefId$C$core..hash..BuildHasher
24: 0x7ffaa57c83fd - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green::hd5d86015fdc5f141
25: 0x7ffaa56cf419 - <rustc_span::def_id::DefIndex as rustc_query_impl::profiling_support::SpecIntoSelfProfilingString>::spec_to_self_profile_string::h385a8e115e139384
26: 0x7ffaa5468979 - <rustc_mir_dataflow::framework::cursor::CursorPosition as core::fmt::Debug>::fmt::h758f734727003b57
27: 0x7ffaa5621d8d - <rustc_mir_dataflow::framework::cursor::CursorPosition as core::fmt::Debug>::fmt::h758f734727003b57
28: 0x7ffaa5756bee - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green::hd5d86015fdc5f141
29: 0x7ffaa6417650 - rustc_middle::ty::fast_reject::simplify_type::h40c4584b9685c597
30: 0x7ffaa6564440 - <rustc_middle::ty::FoundRelationships as core::fmt::Debug>::fmt::h72229b07eb4379e5
31: 0x7ffaa640171d - <rustc_middle::mir::predecessors::PredecessorCache as core::fmt::Debug>::fmt::hf073f20549d691e6
32: 0x7ffaa6565136 - <rustc_middle::ty::FoundRelationships as core::fmt::Debug>::fmt::h72229b07eb4379e5
33: 0x7ffaa651d591 - <rustc_middle::ty::layout::LayoutError as core::fmt::Display>::fmt::h5d0eaaff4515cbd2
34: 0x7ffaa6519d0d - <rustc_middle::ty::layout::LayoutError as core::fmt::Display>::fmt::h5d0eaaff4515cbd2
35: 0x7ffaa571048f - ZN16rustc_query_impl13on_disk_cache260_$LT$impl$u20$rustc_serialize..serialize..Decodable$LT$rustc_query_impl..on_disk_cache..CacheDecoder$GT$$u20$for$u20$$RF$std..collections..hash..set..HashSet$LT$rustc_span..def_id..LocalDefId$C$core..hash..BuildHasher
36: 0x7ffaa57c83fd - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green::hd5d86015fdc5f141
37: 0x7ffaa56cf419 - <rustc_span::def_id::DefIndex as rustc_query_impl::profiling_support::SpecIntoSelfProfilingString>::spec_to_self_profile_string::h385a8e115e139384
38: 0x7ffaa5468979 - <rustc_mir_dataflow::framework::cursor::CursorPosition as core::fmt::Debug>::fmt::h758f734727003b57
39: 0x7ffaa5621d8d - <rustc_mir_dataflow::framework::cursor::CursorPosition as core::fmt::Debug>::fmt::h758f734727003b57
40: 0x7ffaa5756bee - <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::try_mark_green::hd5d86015fdc5f141
41: 0x7ffaa590d6eb - rustc_codegen_ssa::debuginfo::type_names::compute_debuginfo_type_name::ha53b5a5beb7c17b2
42: 0x7ffaa590cb9e - rustc_codegen_ssa::debuginfo::type_names::compute_debuginfo_type_name::ha53b5a5beb7c17b2
43: 0x7ffaa591087e - rustc_codegen_ssa::debuginfo::type_names::push_item_name::h1632b7350de946c5
44: 0x7ffaa590faa3 - rustc_codegen_ssa::debuginfo::type_names::compute_debuginfo_vtable_name::hc21b1172454a88a3
45: 0x7ffaa218b64c - rustc_interface::proc_macro_decls::provide::h8e0f81991a52f33f
46: 0x7ffaa22412ff - rustc_codegen_llvm::type_::<impl rustc_codegen_ssa::traits::type_::LayoutTypeMethods for rustc_codegen_llvm::context::CodegenCx>::reg_backend_type::h6bc98a7a28af19ca
47: 0x7ffaa22011da - <rustc_codegen_llvm::builder::Builder as core::ops::drop::Drop>::drop::h9eb5341754d24cfa
48: 0x7ffaa2200be5 - <rustc_codegen_llvm::builder::Builder as core::ops::drop::Drop>::drop::h9eb5341754d24cfa
49: 0x7ffaa2200be5 - <rustc_codegen_llvm::builder::Builder as core::ops::drop::Drop>::drop::h9eb5341754d24cfa
50: 0x7ffaa22a95a3 - <rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::pointee_info_at::h67e4080bbda4d108
51: 0x7ffaa229a523 - <rustc_target::abi::TyAndLayout<&rustc_middle::ty::TyS> as rustc_codegen_llvm::type_of::LayoutLlvmExt>::pointee_info_at::h67e4080bbda4d108
52: 0x7ffaa2205ae2 - <rustc_codegen_llvm::builder::Builder as core::ops::drop::Drop>::drop::h9eb5341754d24cfa
53: 0x7ffaa225fc2b - <rustc_codegen_llvm::base::ValueIter as core::iter::traits::iterator::Iterator>::next::h04b5a4806aba46a6
54: 0x7ffaa21bfd1e - <rustc_codegen_llvm::llvm_::archive_ro::Child as core::ops::drop::Drop>::drop::h30571d76cb992c7a
55: 0x7ffaa21ec355 - <rustc_codegen_llvm::builder::Builder as core::ops::drop::Drop>::drop::h9eb5341754d24cfa
56: 0x7ffaa225f473 - <rustc_codegen_llvm::base::ValueIter as core::iter::traits::iterator::Iterator>::next::h04b5a4806aba46a6
57: 0x7ffaa2203f3c - <rustc_codegen_llvm::builder::Builder as core::ops::drop::Drop>::drop::h9eb5341754d24cfa
58: 0x7ffaa224d7eb - <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate::hf5b4829af440970a
59: 0x7ffaa21608c2 - rustc_interface::passes::boxed_resolver::BoxedResolver::to_resolver_outputs::h3a5e602db6d7b4fc
60: 0x7ffaa20ab1db - rustc_interface::queries::Linker::link::ha20e6f2f9d9f5135
61: 0x7ffaa20910af - rustc_interface::queries::Queries::ongoing_codegen::h413df41e67b86aaa
62: 0x7ffaa1f9e868 - <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt::h811be12181c3e66a
63: 0x7ffaa1f52fd6 - rustc_driver::pretty::print_after_hir_lowering::h699b7d455148247e
64: 0x7ffaa1f9fcc6 - <rustc_middle::ty::SymbolName as core::fmt::Display>::fmt::h811be12181c3e66a
65: 0x7ffaa1f596a3 - rustc_driver::pretty::print_after_hir_lowering::h699b7d455148247e
66: 0x7ffaa1fca1d8 - <rustc_driver::args::Error as core::fmt::Debug>::fmt::h7eabc0965e0c9a3f
67: 0x7ffab95994ec - std::sys::windows::thread::Thread::new::he49a5cdb1d3d1cfc
68: 0x7ffb3fbe7034 - BaseThreadInitThunk
69: 0x7ffb40742651 - RtlUserThreadStart
Bisecting reveals this was injected by #89597 (cc @michaelwoerister):
searched nightlies: from nightly-2021-06-01 to nightly-2021-10-18
regressed nightly: nightly-2021-10-12
searched commits: from https://github.com/rust-lang/rust/commit/41dfaaa3c66759395835b3af59b22f4f22175dc8 to https://github.com/rust-lang/rust/commit/5b210643ebf2485aafdf2494de8cf41941a64e95
regressed commit: https://github.com/rust-lang/rust/commit/9a757817c352801de8b0593728f8aee21e23cd53
bisected with cargo-bisect-rustc v0.6.0
Host triple: x86_64-pc-windows-msvc
Reproduce with:
cargo bisect-rustc --start=2021-06-01
Metadata
Metadata
Assignees
Labels
Area: Debugging information in compiled programs (DWARF, PDB, etc.)Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Toolchain: MSVC, Operating system: WindowsCritical priorityRelevant to the compiler team, which will review and decide on the PR/issue.Performance or correctness regression from stable to beta.