Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', #95153

Closed
kije opened this issue Mar 20, 2022 · 1 comment
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@kije
Copy link

kije commented Mar 20, 2022

Tried to compile the bevy game template.

Compiling the template without changes worked fine. After I made the following changes, the error occurred:

Cargo.toml

# replaced the `profile.*` settings with thee following: 

[profile.dev.package."*"]
opt-level = 3

[profile.dev]
opt-level = 1

[profile.release]
lto = true
codegen-units = 1
opt-level = 3
strip = "symbols"

[profile.release.package."*"]
opt-level = 3
codegen-units = 1
strip = "symbols"

.cargo/config.toml

[target.wasm32-unknown-unknown]
runner = "wasm-server-runner"

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld", "-C", "target-cpu=native", "-Zshare-generics=y"]

# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-C", "target-cpu=native", "-Zshare-generics=y"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-C", "target-cpu=native", "-Zshare-generics=y"]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
rustflags = ["-C", "target-cpu=native", "-Zshare-generics=n"]

Meta

rustc 1.61.0-nightly (58f11791a 2022-03-17)
binary: rustc
commit-hash: 58f11791af4f97572e7afd83f11cffe04bbbd12f
commit-date: 2022-03-17
host: x86_64-apple-darwin
release: 1.61.0-nightly
LLVM version: 14.0.0

Error output

thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/58f11791af4f97572e7afd83f11cffe04bbbd12f/compiler/rustc_middle/src/ty/sty.rs:1089:9
stack backtrace:
   0:        0x10f021fe4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h907ea1d00231da78
   1:        0x10f07a67b - core::fmt::write::h085fcf3b08377a3f
   2:        0x10f014878 - std::io::Write::write_fmt::hc8a929d414d424cb
   3:        0x10f02551d - std::panicking::default_hook::{{closure}}::ha7dc8bd0abe5497a
   4:        0x10f025201 - std::panicking::default_hook::hcd78f7841328b382
   5:        0x10674fa0a - rustc_driver[6e8c4cbc7453ee53]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x10f025c86 - std::panicking::rust_panic_with_hook::hc9460ca87c3309f2
   7:        0x10f025a8a - std::panicking::begin_panic_handler::{{closure}}::h72ef67232da8dbd7
   8:        0x10f022467 - std::sys_common::backtrace::__rust_end_short_backtrace::h5aa31de72000373d
   9:        0x10f02579a - _rust_begin_unwind
  10:        0x10f0a3c63 - core::panicking::panic_fmt::hf26eb14680cec415
  11:        0x10f0a3b47 - core::panicking::panic::h4c914e6d2f575540
  12:        0x10a983b4c - rustc_trait_selection[7622204370f5a68a]::traits::type_known_to_meet_bound_modulo_regions
  13:        0x1095146c9 - <rustc_infer[46b31c8fb01f21fc]::infer::InferCtxtBuilder>::enter::<bool, rustc_ty_utils[6859a9bb29e38c65]::common_traits::is_item_raw::{closure#0}>
  14:        0x10951ad2d - rustc_ty_utils[6859a9bb29e38c65]::common_traits::is_item_raw
  15:        0x109dd5c75 - rustc_query_system[dfd12e595502c2b7]::query::plumbing::try_execute_query::<rustc_query_impl[8e1f6f497f51e311]::plumbing::QueryCtxt, rustc_query_system[dfd12e595502c2b7]::query::caches::DefaultCache<rustc_middle[c50e64e29e088752]::ty::ParamEnvAnd<rustc_middle[c50e64e29e088752]::ty::Ty>, bool>>
  16:        0x109ebd6f4 - rustc_query_system[dfd12e595502c2b7]::query::plumbing::get_query::<rustc_query_impl[8e1f6f497f51e311]::queries::is_sized_raw, rustc_query_impl[8e1f6f497f51e311]::plumbing::QueryCtxt>
  17:        0x10ac8f646 - <rustc_middle[c50e64e29e088752]::ty::Ty>::is_sized
  18:        0x10abcb43f - <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached
  19:        0x10abe48b6 - rustc_middle[c50e64e29e088752]::ty::layout::layout_of
  20:        0x109ef1228 - rustc_query_system[dfd12e595502c2b7]::query::plumbing::get_query::<rustc_query_impl[8e1f6f497f51e311]::queries::layout_of, rustc_query_impl[8e1f6f497f51e311]::plumbing::QueryCtxt>
  21:        0x10a13ae30 - <rustc_query_impl[8e1f6f497f51e311]::Queries as rustc_middle[c50e64e29e088752]::ty::query::QueryEngine>::layout_of
  22:        0x10ac13d94 - <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt> as rustc_middle[c50e64e29e088752]::ty::layout::LayoutOf>::layout_of
  23:        0x10ac04649 - <alloc[7df9944d07507aec]::vec::Vec<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>> as alloc[7df9944d07507aec]::vec::spec_from_iter::SpecFromIter<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>, core[e5c20307174f109f]::iter::adapters::GenericShunt<core[e5c20307174f109f]::iter::adapters::map::Map<core[e5c20307174f109f]::slice::iter::Iter<rustc_middle[c50e64e29e088752]::ty::FieldDef>, <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[e5c20307174f109f]::result::Result<core[e5c20307174f109f]::convert::Infallible, rustc_middle[c50e64e29e088752]::ty::layout::LayoutError>>>>::from_iter
  24:        0x10ac0397c - <alloc[7df9944d07507aec]::vec::Vec<alloc[7df9944d07507aec]::vec::Vec<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>>> as alloc[7df9944d07507aec]::vec::spec_from_iter::SpecFromIter<alloc[7df9944d07507aec]::vec::Vec<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>>, core[e5c20307174f109f]::iter::adapters::GenericShunt<core[e5c20307174f109f]::iter::adapters::map::Map<core[e5c20307174f109f]::slice::iter::Iter<rustc_middle[c50e64e29e088752]::ty::VariantDef>, <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[e5c20307174f109f]::result::Result<core[e5c20307174f109f]::convert::Infallible, rustc_middle[c50e64e29e088752]::ty::layout::LayoutError>>>>::from_iter
  25:        0x10abca732 - <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached
  26:        0x10abe48b6 - rustc_middle[c50e64e29e088752]::ty::layout::layout_of
  27:        0x109ef1228 - rustc_query_system[dfd12e595502c2b7]::query::plumbing::get_query::<rustc_query_impl[8e1f6f497f51e311]::queries::layout_of, rustc_query_impl[8e1f6f497f51e311]::plumbing::QueryCtxt>
  28:        0x10a13ae30 - <rustc_query_impl[8e1f6f497f51e311]::Queries as rustc_middle[c50e64e29e088752]::ty::query::QueryEngine>::layout_of
  29:        0x10ac13d94 - <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt> as rustc_middle[c50e64e29e088752]::ty::layout::LayoutOf>::layout_of
  30:        0x10ac04649 - <alloc[7df9944d07507aec]::vec::Vec<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>> as alloc[7df9944d07507aec]::vec::spec_from_iter::SpecFromIter<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>, core[e5c20307174f109f]::iter::adapters::GenericShunt<core[e5c20307174f109f]::iter::adapters::map::Map<core[e5c20307174f109f]::slice::iter::Iter<rustc_middle[c50e64e29e088752]::ty::FieldDef>, <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[e5c20307174f109f]::result::Result<core[e5c20307174f109f]::convert::Infallible, rustc_middle[c50e64e29e088752]::ty::layout::LayoutError>>>>::from_iter
  31:        0x10ac0397c - <alloc[7df9944d07507aec]::vec::Vec<alloc[7df9944d07507aec]::vec::Vec<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>>> as alloc[7df9944d07507aec]::vec::spec_from_iter::SpecFromIter<alloc[7df9944d07507aec]::vec::Vec<rustc_target[2553ca8a51307287]::abi::TyAndLayout<rustc_middle[c50e64e29e088752]::ty::Ty>>, core[e5c20307174f109f]::iter::adapters::GenericShunt<core[e5c20307174f109f]::iter::adapters::map::Map<core[e5c20307174f109f]::slice::iter::Iter<rustc_middle[c50e64e29e088752]::ty::VariantDef>, <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[e5c20307174f109f]::result::Result<core[e5c20307174f109f]::convert::Infallible, rustc_middle[c50e64e29e088752]::ty::layout::LayoutError>>>>::from_iter
  32:        0x10abca732 - <rustc_middle[c50e64e29e088752]::ty::layout::LayoutCx<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt>>::layout_of_uncached
  33:        0x10abe48b6 - rustc_middle[c50e64e29e088752]::ty::layout::layout_of
  34:        0x109ef1228 - rustc_query_system[dfd12e595502c2b7]::query::plumbing::get_query::<rustc_query_impl[8e1f6f497f51e311]::queries::layout_of, rustc_query_impl[8e1f6f497f51e311]::plumbing::QueryCtxt>
  35:        0x10a13ae30 - <rustc_query_impl[8e1f6f497f51e311]::Queries as rustc_middle[c50e64e29e088752]::ty::query::QueryEngine>::layout_of
  36:        0x10a19d540 - rustc_codegen_ssa[6763b96149b79971]::debuginfo::type_names::push_debuginfo_type_name
  37:        0x10a19f3e9 - rustc_codegen_ssa[6763b96149b79971]::debuginfo::type_names::push_debuginfo_type_name
  38:        0x10a19c6e7 - rustc_codegen_ssa[6763b96149b79971]::debuginfo::type_names::compute_debuginfo_type_name
  39:        0x1069ea77c - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_dyn_type_di_node
  40:        0x1069eadc0 - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::type_di_node
  41:        0x1069ea3df - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_pointer_or_reference_di_node
  42:        0x1069eaeae - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::type_di_node
  43:        0x1069de30d - <&mut rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_struct_type_di_node::{closure#0}::{closure#0} as core[e5c20307174f109f]::ops::function::FnOnce<((usize, &rustc_middle[c50e64e29e088752]::ty::FieldDef),)>>::call_once
  44:        0x106a14861 - <smallvec[e07987c63fe0a74c]::SmallVec<[&rustc_codegen_llvm[85faa35d8a975e41]::llvm_::ffi::Metadata; 16usize]> as core[e5c20307174f109f]::iter::traits::collect::Extend<&rustc_codegen_llvm[85faa35d8a975e41]::llvm_::ffi::Metadata>>::extend::<core[e5c20307174f109f]::iter::adapters::map::Map<core[e5c20307174f109f]::iter::adapters::enumerate::Enumerate<core[e5c20307174f109f]::slice::iter::Iter<rustc_middle[c50e64e29e088752]::ty::FieldDef>>, rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_struct_type_di_node::{closure#0}::{closure#0}>>
  45:        0x1068f2817 - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_struct_type_di_node::{closure#0}, rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_struct_type_di_node::{closure#1}>
  46:        0x1069ed3d5 - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_struct_type_di_node
  47:        0x1069eb210 - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::type_di_node
  48:        0x1069ea3df - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::build_pointer_or_reference_di_node
  49:        0x1069eac8e - rustc_codegen_llvm[85faa35d8a975e41]::debuginfo::metadata::type_di_node
  50:        0x1069a4740 - <rustc_codegen_llvm[85faa35d8a975e41]::context::CodegenCx as rustc_codegen_ssa[6763b96149b79971]::traits::debuginfo::DebugInfoMethods>::dbg_scope_fn::get_function_signature
  51:        0x106988e50 - <rustc_codegen_llvm[85faa35d8a975e41]::context::CodegenCx as rustc_codegen_ssa[6763b96149b79971]::traits::debuginfo::DebugInfoMethods>::dbg_scope_fn
  52:        0x106988a58 - <rustc_codegen_llvm[85faa35d8a975e41]::context::CodegenCx as rustc_codegen_ssa[6763b96149b79971]::traits::debuginfo::DebugInfoMethods>::create_function_debug_context
  53:        0x1069f3105 - rustc_codegen_ssa[6763b96149b79971]::mir::codegen_mir::<rustc_codegen_llvm[85faa35d8a975e41]::builder::Builder>
  54:        0x1068dcde9 - rustc_codegen_ssa[6763b96149b79971]::base::codegen_instance::<rustc_codegen_llvm[85faa35d8a975e41]::builder::Builder>
  55:        0x1069c946a - <rustc_middle[c50e64e29e088752]::mir::mono::MonoItem as rustc_codegen_ssa[6763b96149b79971]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[85faa35d8a975e41]::builder::Builder>
  56:        0x106927b47 - rustc_codegen_llvm[85faa35d8a975e41]::base::compile_codegen_unit::module_codegen
  57:        0x1069641db - <rustc_query_system[dfd12e595502c2b7]::dep_graph::graph::DepGraph<rustc_middle[c50e64e29e088752]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[c50e64e29e088752]::ty::context::TyCtxt, rustc_span[7e8018d880b7954b]::symbol::Symbol, rustc_codegen_ssa[6763b96149b79971]::ModuleCodegen<rustc_codegen_llvm[85faa35d8a975e41]::ModuleLlvm>>
  58:        0x106927406 - rustc_codegen_llvm[85faa35d8a975e41]::base::compile_codegen_unit
  59:        0x1068fd03f - <rustc_codegen_llvm[85faa35d8a975e41]::LlvmCodegenBackend as rustc_codegen_ssa[6763b96149b79971]::traits::backend::CodegenBackend>::codegen_crate
  60:        0x1068a83e2 - <rustc_session[d189dd9876c6da7c]::session::Session>::time::<alloc[7df9944d07507aec]::boxed::Box<dyn core[e5c20307174f109f]::any::Any>, rustc_interface[36e2d9e25c12dd17]::passes::start_codegen::{closure#0}>
  61:        0x10685e1bb - <rustc_interface[36e2d9e25c12dd17]::passes::QueryContext>::enter::<<rustc_interface[36e2d9e25c12dd17]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[e5c20307174f109f]::result::Result<alloc[7df9944d07507aec]::boxed::Box<dyn core[e5c20307174f109f]::any::Any>, rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>
  62:        0x1068420a9 - <rustc_interface[36e2d9e25c12dd17]::queries::Queries>::ongoing_codegen
  63:        0x1066e01aa - <rustc_interface[36e2d9e25c12dd17]::interface::Compiler>::enter::<rustc_driver[6e8c4cbc7453ee53]::run_compiler::{closure#1}::{closure#2}, core[e5c20307174f109f]::result::Result<core[e5c20307174f109f]::option::Option<rustc_interface[36e2d9e25c12dd17]::queries::Linker>, rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>
  64:        0x1066fdd18 - rustc_span[7e8018d880b7954b]::with_source_map::<core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>, rustc_interface[36e2d9e25c12dd17]::interface::create_compiler_and_run<core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>, rustc_driver[6e8c4cbc7453ee53]::run_compiler::{closure#1}>::{closure#1}>
  65:        0x1066e0c2a - rustc_interface[36e2d9e25c12dd17]::interface::create_compiler_and_run::<core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>, rustc_driver[6e8c4cbc7453ee53]::run_compiler::{closure#1}>
  66:        0x1066da765 - <scoped_tls[d5f8365db6ef3472]::ScopedKey<rustc_span[7e8018d880b7954b]::SessionGlobals>>::set::<rustc_interface[36e2d9e25c12dd17]::interface::run_compiler<core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>, rustc_driver[6e8c4cbc7453ee53]::run_compiler::{closure#1}>::{closure#0}, core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>
  67:        0x1066d4ac9 - std[e6b7afb3db6e4c83]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[36e2d9e25c12dd17]::util::run_in_thread_pool_with_globals<rustc_interface[36e2d9e25c12dd17]::interface::run_compiler<core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>, rustc_driver[6e8c4cbc7453ee53]::run_compiler::{closure#1}>::{closure#0}, core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>::{closure#0}, core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>
  68:        0x106709f72 - <<std[e6b7afb3db6e4c83]::thread::Builder>::spawn_unchecked_<rustc_interface[36e2d9e25c12dd17]::util::run_in_thread_pool_with_globals<rustc_interface[36e2d9e25c12dd17]::interface::run_compiler<core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>, rustc_driver[6e8c4cbc7453ee53]::run_compiler::{closure#1}>::{closure#0}, core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>::{closure#0}, core[e5c20307174f109f]::result::Result<(), rustc_errors[bf69d8ce7e94525f]::ErrorGuaranteed>>::{closure#1} as core[e5c20307174f109f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:        0x10f02f3f7 - std::sys::unix::thread::Thread::new::thread_start::h0239b7f7a3ede746
  70:     0x7fff2060b8fc - __pthread_start

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.61.0-nightly (58f11791a 2022-03-17) running on x86_64-apple-darwin

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C debug-assertions=on -C link-arg=-fuse-ld=/usr/local/bin/zld -C target-cpu=native -Z share-generics=y

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [is_sized_raw] computing whether `dyn std::io::Write` is `Sized`
#1 [layout_of] computing layout of `*const dyn std::io::Write`
#2 [layout_of] computing layout of `core::ptr::unique::Unique<dyn std::io::Write>`
#3 [layout_of] computing layout of `alloc::boxed::Box<dyn std::io::Write>`
end of query stack

@kije kije added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 20, 2022
@kije
Copy link
Author

kije commented Mar 20, 2022

Looks like the same issue as this one #94998

@kije kije closed this as completed Mar 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant