Skip to content
New issue

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

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

Already on GitHub? # to your account

assertion failed: !value.has_escaping_bound_vars(): ICE when compiling crate tracing-subscriber v0.3.9 #94998

Closed
chenzhuoyu opened this issue Mar 16, 2022 · 20 comments · Fixed by #95020
Assignees
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@chenzhuoyu
Copy link

chenzhuoyu commented Mar 16, 2022

Code

Cargo.toml

[package]
name = "test_rustc_ice"
version = "0.1.0"
edition = "2021"

[dependencies]
tracing-subscriber = "0.3.9"

rust-toolchain.toml

[toolchain]
channel = "nightly"

src/main.rs

fn main() {
    println!("Hello, world!");
}

Meta

rustc --version --verbose:

rustc 1.61.0-nightly (52b34550a 2022-03-15)
binary: rustc
commit-hash: 52b34550aca5f7dd7e152f773e3ab786acb86f6f
commit-date: 2022-03-15
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/52b34550aca5f7dd7e152f773e3ab786acb86f6f/compiler/rustc_middle/src/ty/sty.rs:1089:9
Backtrace

   Compiling tracing-subscriber v0.3.9
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/52b34550aca5f7dd7e152f773e3ab786acb86f6f/compiler/rustc_middle/src/ty/sty.rs:1089:9
stack backtrace:
   0:        0x10ba2ffb4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h254d4b149dd42021
   1:        0x10ba8864b - core::fmt::write::h75fa52a54c4c085a
   2:        0x10ba22798 - std::io::Write::write_fmt::h5beb680276d373ed
   3:        0x10ba334ed - std::panicking::default_hook::{{closure}}::h44a470242caad290
   4:        0x10ba331d1 - std::panicking::default_hook::heb3bf7a1a99fd831
   5:        0x119d639fa - rustc_driver[68f5af5f4fbd43df]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x10ba33c56 - std::panicking::rust_panic_with_hook::h3835de48593d565d
   7:        0x10ba33a5a - std::panicking::begin_panic_handler::{{closure}}::hf5992e479f8a449b
   8:        0x10ba30437 - std::sys_common::backtrace::__rust_end_short_backtrace::hd7d94f69adb52ab6
   9:        0x10ba3376a - _rust_begin_unwind
  10:        0x10bab1c33 - core::panicking::panic_fmt::hc66f4ee528ad596d
  11:        0x10bab1b17 - core::panicking::panic::h7973c4c5a950ee25
  12:        0x11df959cc - rustc_trait_selection[718c1d978defa14d]::traits::type_known_to_meet_bound_modulo_regions
  13:        0x11cb28b79 - <rustc_infer[1fa14ac0600d063c]::infer::InferCtxtBuilder>::enter::<bool, rustc_ty_utils[5b827f266eb119e4]::common_traits::is_item_raw::{closure#0}>
  14:        0x11cb2f1dd - rustc_ty_utils[5b827f266eb119e4]::common_traits::is_item_raw
  15:        0x11d3e81a5 - rustc_query_system[d6602a5114bfb900]::query::plumbing::try_execute_query::<rustc_query_impl[da14cdaa7c74b32b]::plumbing::QueryCtxt, rustc_query_system[d6602a5114bfb900]::query::caches::DefaultCache<rustc_middle[6028c850d8428a7e]::ty::ParamEnvAnd<rustc_middle[6028c850d8428a7e]::ty::Ty>, bool>>
  16:        0x11d4cfc24 - rustc_query_system[d6602a5114bfb900]::query::plumbing::get_query::<rustc_query_impl[da14cdaa7c74b32b]::queries::is_sized_raw, rustc_query_impl[da14cdaa7c74b32b]::plumbing::QueryCtxt>
  17:        0x11e2a12c6 - <rustc_middle[6028c850d8428a7e]::ty::Ty>::is_sized
  18:        0x11e1dd0bf - <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached
  19:        0x11e1f6536 - rustc_middle[6028c850d8428a7e]::ty::layout::layout_of
  20:        0x11d503758 - rustc_query_system[d6602a5114bfb900]::query::plumbing::get_query::<rustc_query_impl[da14cdaa7c74b32b]::queries::layout_of, rustc_query_impl[da14cdaa7c74b32b]::plumbing::QueryCtxt>
  21:        0x11d74d360 - <rustc_query_impl[da14cdaa7c74b32b]::Queries as rustc_middle[6028c850d8428a7e]::ty::query::QueryEngine>::layout_of
  22:        0x11e225a14 - <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt> as rustc_middle[6028c850d8428a7e]::ty::layout::LayoutOf>::layout_of
  23:        0x11e2162c9 - <alloc[4452997152f96314]::vec::Vec<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>> as alloc[4452997152f96314]::vec::spec_from_iter::SpecFromIter<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>, core[bf1d29f64462da08]::iter::adapters::GenericShunt<core[bf1d29f64462da08]::iter::adapters::map::Map<core[bf1d29f64462da08]::slice::iter::Iter<rustc_middle[6028c850d8428a7e]::ty::FieldDef>, <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[bf1d29f64462da08]::result::Result<core[bf1d29f64462da08]::convert::Infallible, rustc_middle[6028c850d8428a7e]::ty::layout::LayoutError>>>>::from_iter
  24:        0x11e2155fc - <alloc[4452997152f96314]::vec::Vec<alloc[4452997152f96314]::vec::Vec<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>>> as alloc[4452997152f96314]::vec::spec_from_iter::SpecFromIter<alloc[4452997152f96314]::vec::Vec<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>>, core[bf1d29f64462da08]::iter::adapters::GenericShunt<core[bf1d29f64462da08]::iter::adapters::map::Map<core[bf1d29f64462da08]::slice::iter::Iter<rustc_middle[6028c850d8428a7e]::ty::VariantDef>, <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[bf1d29f64462da08]::result::Result<core[bf1d29f64462da08]::convert::Infallible, rustc_middle[6028c850d8428a7e]::ty::layout::LayoutError>>>>::from_iter
  25:        0x11e1dc3b2 - <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached
  26:        0x11e1f6536 - rustc_middle[6028c850d8428a7e]::ty::layout::layout_of
  27:        0x11d503758 - rustc_query_system[d6602a5114bfb900]::query::plumbing::get_query::<rustc_query_impl[da14cdaa7c74b32b]::queries::layout_of, rustc_query_impl[da14cdaa7c74b32b]::plumbing::QueryCtxt>
  28:        0x11d74d360 - <rustc_query_impl[da14cdaa7c74b32b]::Queries as rustc_middle[6028c850d8428a7e]::ty::query::QueryEngine>::layout_of
  29:        0x11e225a14 - <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt> as rustc_middle[6028c850d8428a7e]::ty::layout::LayoutOf>::layout_of
  30:        0x11e2162c9 - <alloc[4452997152f96314]::vec::Vec<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>> as alloc[4452997152f96314]::vec::spec_from_iter::SpecFromIter<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>, core[bf1d29f64462da08]::iter::adapters::GenericShunt<core[bf1d29f64462da08]::iter::adapters::map::Map<core[bf1d29f64462da08]::slice::iter::Iter<rustc_middle[6028c850d8428a7e]::ty::FieldDef>, <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}::{closure#0}>, core[bf1d29f64462da08]::result::Result<core[bf1d29f64462da08]::convert::Infallible, rustc_middle[6028c850d8428a7e]::ty::layout::LayoutError>>>>::from_iter
  31:        0x11e2155fc - <alloc[4452997152f96314]::vec::Vec<alloc[4452997152f96314]::vec::Vec<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>>> as alloc[4452997152f96314]::vec::spec_from_iter::SpecFromIter<alloc[4452997152f96314]::vec::Vec<rustc_target[579aeb433b1fb1a0]::abi::TyAndLayout<rustc_middle[6028c850d8428a7e]::ty::Ty>>, core[bf1d29f64462da08]::iter::adapters::GenericShunt<core[bf1d29f64462da08]::iter::adapters::map::Map<core[bf1d29f64462da08]::slice::iter::Iter<rustc_middle[6028c850d8428a7e]::ty::VariantDef>, <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached::{closure#5}>, core[bf1d29f64462da08]::result::Result<core[bf1d29f64462da08]::convert::Infallible, rustc_middle[6028c850d8428a7e]::ty::layout::LayoutError>>>>::from_iter
  32:        0x11e1dc3b2 - <rustc_middle[6028c850d8428a7e]::ty::layout::LayoutCx<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt>>::layout_of_uncached
  33:        0x11e1f6536 - rustc_middle[6028c850d8428a7e]::ty::layout::layout_of
  34:        0x11d503758 - rustc_query_system[d6602a5114bfb900]::query::plumbing::get_query::<rustc_query_impl[da14cdaa7c74b32b]::queries::layout_of, rustc_query_impl[da14cdaa7c74b32b]::plumbing::QueryCtxt>
  35:        0x11d74d360 - <rustc_query_impl[da14cdaa7c74b32b]::Queries as rustc_middle[6028c850d8428a7e]::ty::query::QueryEngine>::layout_of
  36:        0x11d7afa70 - rustc_codegen_ssa[50d8efce28531570]::debuginfo::type_names::push_debuginfo_type_name
  37:        0x11d7b1919 - rustc_codegen_ssa[50d8efce28531570]::debuginfo::type_names::push_debuginfo_type_name
  38:        0x11d7aec17 - rustc_codegen_ssa[50d8efce28531570]::debuginfo::type_names::compute_debuginfo_type_name
  39:        0x119ffea7c - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_dyn_type_di_node
  40:        0x119fff0c0 - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::type_di_node
  41:        0x119ffe6df - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_pointer_or_reference_di_node
  42:        0x119fff1ae - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::type_di_node
  43:        0x119ff260d - <&mut rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_struct_type_di_node::{closure#0}::{closure#0} as core[bf1d29f64462da08]::ops::function::FnOnce<((usize, &rustc_middle[6028c850d8428a7e]::ty::FieldDef),)>>::call_once
  44:        0x11a028b61 - <smallvec[5b7c613378500725]::SmallVec<[&rustc_codegen_llvm[7611e23cd93720f5]::llvm_::ffi::Metadata; 16usize]> as core[bf1d29f64462da08]::iter::traits::collect::Extend<&rustc_codegen_llvm[7611e23cd93720f5]::llvm_::ffi::Metadata>>::extend::<core[bf1d29f64462da08]::iter::adapters::map::Map<core[bf1d29f64462da08]::iter::adapters::enumerate::Enumerate<core[bf1d29f64462da08]::slice::iter::Iter<rustc_middle[6028c850d8428a7e]::ty::FieldDef>>, rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_struct_type_di_node::{closure#0}::{closure#0}>>
  45:        0x119f066c7 - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::type_map::build_type_with_children::<rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_struct_type_di_node::{closure#0}, rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_struct_type_di_node::{closure#1}>
  46:        0x11a0016d5 - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_struct_type_di_node
  47:        0x119fff510 - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::type_di_node
  48:        0x119ffe6df - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::build_pointer_or_reference_di_node
  49:        0x119ffef8e - rustc_codegen_llvm[7611e23cd93720f5]::debuginfo::metadata::type_di_node
  50:        0x119fb8a40 - <rustc_codegen_llvm[7611e23cd93720f5]::context::CodegenCx as rustc_codegen_ssa[50d8efce28531570]::traits::debuginfo::DebugInfoMethods>::dbg_scope_fn::get_function_signature
  51:        0x119f9d150 - <rustc_codegen_llvm[7611e23cd93720f5]::context::CodegenCx as rustc_codegen_ssa[50d8efce28531570]::traits::debuginfo::DebugInfoMethods>::dbg_scope_fn
  52:        0x119f9cd58 - <rustc_codegen_llvm[7611e23cd93720f5]::context::CodegenCx as rustc_codegen_ssa[50d8efce28531570]::traits::debuginfo::DebugInfoMethods>::create_function_debug_context
  53:        0x11a007425 - rustc_codegen_ssa[50d8efce28531570]::mir::codegen_mir::<rustc_codegen_llvm[7611e23cd93720f5]::builder::Builder>
  54:        0x119ef0d39 - rustc_codegen_ssa[50d8efce28531570]::base::codegen_instance::<rustc_codegen_llvm[7611e23cd93720f5]::builder::Builder>
  55:        0x119fdd76a - <rustc_middle[6028c850d8428a7e]::mir::mono::MonoItem as rustc_codegen_ssa[50d8efce28531570]::mono_item::MonoItemExt>::define::<rustc_codegen_llvm[7611e23cd93720f5]::builder::Builder>
  56:        0x119f3b9f7 - rustc_codegen_llvm[7611e23cd93720f5]::base::compile_codegen_unit::module_codegen
  57:        0x119f791bb - <rustc_query_system[d6602a5114bfb900]::dep_graph::graph::DepGraph<rustc_middle[6028c850d8428a7e]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[6028c850d8428a7e]::ty::context::TyCtxt, rustc_span[ea6bf71f02730d2e]::symbol::Symbol, rustc_codegen_ssa[50d8efce28531570]::ModuleCodegen<rustc_codegen_llvm[7611e23cd93720f5]::ModuleLlvm>>
  58:        0x119f3b2b6 - rustc_codegen_llvm[7611e23cd93720f5]::base::compile_codegen_unit
  59:        0x119f10eef - <rustc_codegen_llvm[7611e23cd93720f5]::LlvmCodegenBackend as rustc_codegen_ssa[50d8efce28531570]::traits::backend::CodegenBackend>::codegen_crate
  60:        0x119ebc1e2 - <rustc_session[46a9cee2ec394bd8]::session::Session>::time::<alloc[4452997152f96314]::boxed::Box<dyn core[bf1d29f64462da08]::any::Any>, rustc_interface[bad71de8e7671400]::passes::start_codegen::{closure#0}>
  61:        0x119e71f1b - <rustc_interface[bad71de8e7671400]::passes::QueryContext>::enter::<<rustc_interface[bad71de8e7671400]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[bf1d29f64462da08]::result::Result<alloc[4452997152f96314]::boxed::Box<dyn core[bf1d29f64462da08]::any::Any>, rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>
  62:        0x119e55e99 - <rustc_interface[bad71de8e7671400]::queries::Queries>::ongoing_codegen
  63:        0x119cf43ea - <rustc_interface[bad71de8e7671400]::interface::Compiler>::enter::<rustc_driver[68f5af5f4fbd43df]::run_compiler::{closure#1}::{closure#2}, core[bf1d29f64462da08]::result::Result<core[bf1d29f64462da08]::option::Option<rustc_interface[bad71de8e7671400]::queries::Linker>, rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>
  64:        0x119d16788 - rustc_span[ea6bf71f02730d2e]::with_source_map::<core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>, rustc_interface[bad71de8e7671400]::interface::create_compiler_and_run<core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>, rustc_driver[68f5af5f4fbd43df]::run_compiler::{closure#1}>::{closure#1}>
  65:        0x119cf690a - rustc_interface[bad71de8e7671400]::interface::create_compiler_and_run::<core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>, rustc_driver[68f5af5f4fbd43df]::run_compiler::{closure#1}>
  66:        0x119cecb85 - <scoped_tls[b249fb2a4ee1394c]::ScopedKey<rustc_span[ea6bf71f02730d2e]::SessionGlobals>>::set::<rustc_interface[bad71de8e7671400]::interface::run_compiler<core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>, rustc_driver[68f5af5f4fbd43df]::run_compiler::{closure#1}>::{closure#0}, core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>
  67:        0x119ce8e39 - std[ff2381176b90674b]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[bad71de8e7671400]::util::run_in_thread_pool_with_globals<rustc_interface[bad71de8e7671400]::interface::run_compiler<core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>, rustc_driver[68f5af5f4fbd43df]::run_compiler::{closure#1}>::{closure#0}, core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>::{closure#0}, core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>
  68:        0x119d1d832 - <<std[ff2381176b90674b]::thread::Builder>::spawn_unchecked_<rustc_interface[bad71de8e7671400]::util::run_in_thread_pool_with_globals<rustc_interface[bad71de8e7671400]::interface::run_compiler<core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>, rustc_driver[68f5af5f4fbd43df]::run_compiler::{closure#1}>::{closure#0}, core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>::{closure#0}, core[bf1d29f64462da08]::result::Result<(), rustc_errors[303ac6616d2d060]::ErrorGuaranteed>>::{closure#1} as core[bf1d29f64462da08]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:        0x10ba3d3c7 - std::sys::unix::thread::Thread::new::thread_start::he574bd67be95381d
  70:     0x7ff819ff54f4 - __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 (52b34550a 2022-03-15) running on x86_64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2

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
error: could not compile `tracing-subscriber`

@chenzhuoyu chenzhuoyu 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 16, 2022
@chenzhuoyu
Copy link
Author

nightly-2022-03-14 works fine, but nightly-2022-03-15 crashes with ICE.

@jackh726
Copy link
Member

This is probably a duplicate of #94986.

@jackh726
Copy link
Member

@jackh726
Copy link
Member

(That might not be the cause though)

@compiler-errors
Copy link
Member

No, you're probably right @jackh726. I'll either erase regions during candidate assembly or use something infcx-local to probe if something is Copy.

@rustbot claim

@jackh726
Copy link
Member

Compiling with debug assertions on should be able to pinpoint exactly where things go wrong.

@lqd
Copy link
Member

lqd commented Mar 16, 2022

Bisecting this lead to 0407030 though cc @michaelwoerister

@michaelwoerister
Copy link
Member

👍

@compiler-errors
Copy link
Member

Actually, I do agree that this is probably not due to #93977. @michaelwoerister, I can still fix this though, unless you're gonna take a look at it?

@michaelwoerister
Copy link
Member

@compiler-errors, feel free to take a look. #94997 might be relevant here too (although it does look like a different problem).

@jackh726
Copy link
Member

Welp sorry @compiler-errors

@lqd
Copy link
Member

lqd commented Mar 16, 2022

For either of the two Michaels looking at this: big thanks to @FSMaxB for the small repro from #95018.

pub struct Broken {
    _broken: Box<dyn Fn(&()) -> Box<dyn ToString + '_>>,
}

impl From<Broken> for ()
{
    fn from(_: Broken) -> Self {}
}

(playground)

@djkoloski
Copy link
Contributor

Here's a minimization I left on a duplicate issue:

lib.rs

trait Trait {}

pub fn run(_: &dyn FnOnce(&()) -> Box<dyn Trait + '_>) {}
rustc --crate-type rlib --edition 2018 -Cdebuginfo=2 lib.rs

Note that without -Cdebuginfo=2 this does not ICE.

@jackh726 jackh726 added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. P-critical Critical priority S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue labels Mar 16, 2022
@jackh726
Copy link
Member

Marking as P-critical, since this seems to be getting hit by several people.

@jackh726 jackh726 changed the title ICE when compiling crate tracing-subscriber v0.3.9 assertion failed: !value.has_escaping_bound_vars(): ICE when compiling crate tracing-subscriber v0.3.9 Mar 16, 2022
@jackh726 jackh726 pinned this issue Mar 16, 2022
@jackh726
Copy link
Member

Also changing title and pinning to try to help curb some duplicates.

@vlasfama
Copy link

vlasfama commented Mar 17, 2022

any solution!, I am still facing same error assertion failed: !value.has_escaping_bound_vars() when i try to build 95009

@compiler-errors
Copy link
Member

No, the PR that fixes this is blocked on a CI issue, which will not likely be resolved until tomorrow at this rate.

You may find a temporary fix by downloading an old nightly revision with (e.g.) rustup install nightly-2022-03-14 and setting that as your default for the time being, but please make sure to set it back later. Or, if your project does not use any nightly-only features, I recommend using stable or beta releases for now.

@vlasfama
Copy link

vlasfama commented Mar 17, 2022

Thanks!

@apocello2008
Copy link

Same error!

thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/461e8078010433ff7de2db2aaae8a3cfb0847215\compiler\rustc_middle\src\ty\sty.rs:1089:9

note: rustc 1.61.0-nightly (461e807 2022-03-16) running on x86_64-pc-windows-msvc
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

@jackh726
Copy link
Member

Pinning this at least for a day or so, since the nightly with the fix hasn't even been released.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants