Skip to content

ICE while building tracing-core 0.1.32 with -C link-dead-code #135545

Closed as duplicate of#135515
@tirr-c

Description

@tirr-c

Code

Build tracing-core 0.1.32 with RUSTFLAGS='-C link-dead-code'.

Meta

rustc --version --verbose:

rustc 1.86.0-nightly (8361aef0d 2025-01-14)
binary: rustc
commit-hash: 8361aef0d7c29b1501a316a208ed84cd8a2ae5da
commit-date: 2025-01-14
host: x86_64-unknown-linux-gnu
release: 1.86.0-nightly
LLVM version: 19.1.6

(This doesn't ICE with rustc 1.86.0-nightly (48a426eca 2025-01-12).)

Error output

thread 'rustc' panicked at /rustc/8361aef0d7c29b1501a316a208ed84cd8a2ae5da/compiler/rustc_type_ir/src/binder.rs:806:9:
const parameter `'a/#0` ('a/#0/0) out of range when instantiating args=[]

(stack backtrace)

rustc version: 1.86.0-nightly (8361aef0d 2025-01-14)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [instantiate_and_check_impossible_predicates] checking impossible instantiated predicates: `event::Event`
#1 [collect_and_partition_mono_items] collect_and_partition_mono_items
#2 [exported_symbols] collecting exported symbols for crate `0`
end of query stack
Backtrace

stack backtrace:
   0:     0x7fc136f64365 - std::backtrace::Backtrace::create::h94c4b69a3a7cf605
   1:     0x7fc1354dc585 - std::backtrace::Backtrace::force_capture::h1d236221e642ca65
   2:     0x7fc13465a956 - std[5a9fc012e1d0d0b]::panicking::update_hook::<alloc[ac03dea90177f35f]::boxed::Box<rustc_driver_impl[936c1abaea8466f3]::install_ice_hook::{closure#1}>>::{closure#0}
   3:     0x7fc1354f49b3 - std::panicking::rust_panic_with_hook::h9f82033b55997db2
   4:     0x7fc1354f46aa - std::panicking::begin_panic_handler::{{closure}}::h6ad114e7310ab80d
   5:     0x7fc1354f2249 - std::sys::backtrace::__rust_end_short_backtrace::he1ff5b96e37d697a
   6:     0x7fc1354f436d - rust_begin_unwind
   7:     0x7fc1321a60b0 - core::panicking::panic_fmt::hae91a18acb6521c1
   8:     0x7fc134c057e9 - <rustc_type_ir[829647f3ac930964]::binder::ArgFolder<rustc_middle[6ec8af473b9179e3]::ty::context::TyCtxt>>::region_param_out_of_range
   9:     0x7fc135c45f5d - <rustc_middle[6ec8af473b9179e3]::ty::generics::GenericPredicates>::instantiate_into
  10:     0x7fc1365dcd3b - rustc_trait_selection[d6691d0da25531a1]::traits::instantiate_and_check_impossible_predicates
  11:     0x7fc1365dccb6 - rustc_query_impl[912ffda60ec58dad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[912ffda60ec58dad]::query_impl::instantiate_and_check_impossible_predicates::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 1usize]>>
  12:     0x7fc1365dcc9b - <rustc_query_impl[912ffda60ec58dad]::query_impl::instantiate_and_check_impossible_predicates::dynamic_query::{closure#2} as core[882c985c10ecc76f]::ops::function::FnOnce<(rustc_middle[6ec8af473b9179e3]::ty::context::TyCtxt, (rustc_span[75a95e237d4d0ab1]::def_id::DefId, &rustc_middle[6ec8af473b9179e3]::ty::list::RawList<(), rustc_middle[6ec8af473b9179e3]::ty::generic_args::GenericArg>))>>::call_once
  13:     0x7fc1365dc2b8 - rustc_query_system[6e8935c22d8afd61]::query::plumbing::try_execute_query::<rustc_query_impl[912ffda60ec58dad]::DynamicConfig<rustc_query_system[6e8935c22d8afd61]::query::caches::DefaultCache<(rustc_span[75a95e237d4d0ab1]::def_id::DefId, &rustc_middle[6ec8af473b9179e3]::ty::list::RawList<(), rustc_middle[6ec8af473b9179e3]::ty::generic_args::GenericArg>), rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[912ffda60ec58dad]::plumbing::QueryCtxt, false>
  14:     0x7fc1365dbff6 - rustc_query_impl[912ffda60ec58dad]::query_impl::instantiate_and_check_impossible_predicates::get_query_non_incr::__rust_end_short_backtrace
  15:     0x7fc134e65e6d - rustc_middle[6ec8af473b9179e3]::query::plumbing::query_get_at::<rustc_query_system[6e8935c22d8afd61]::query::caches::DefaultCache<(rustc_span[75a95e237d4d0ab1]::def_id::DefId, &rustc_middle[6ec8af473b9179e3]::ty::list::RawList<(), rustc_middle[6ec8af473b9179e3]::ty::generic_args::GenericArg>), rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 1usize]>>>
  16:     0x7fc1360a5731 - rustc_monomorphize[1a63c6622e9cdd06]::partitioning::collect_and_partition_mono_items
  17:     0x7fc136be2056 - rustc_query_impl[912ffda60ec58dad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[912ffda60ec58dad]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 24usize]>>
  18:     0x7fc136be2037 - <rustc_query_impl[912ffda60ec58dad]::query_impl::collect_and_partition_mono_items::dynamic_query::{closure#2} as core[882c985c10ecc76f]::ops::function::FnOnce<(rustc_middle[6ec8af473b9179e3]::ty::context::TyCtxt, ())>>::call_once
  19:     0x7fc136be1bbc - rustc_query_system[6e8935c22d8afd61]::query::plumbing::try_execute_query::<rustc_query_impl[912ffda60ec58dad]::DynamicConfig<rustc_query_system[6e8935c22d8afd61]::query::caches::SingleCache<rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[912ffda60ec58dad]::plumbing::QueryCtxt, false>
  20:     0x7fc136be18b4 - rustc_query_impl[912ffda60ec58dad]::query_impl::collect_and_partition_mono_items::get_query_non_incr::__rust_end_short_backtrace
  21:     0x7fc136333e93 - rustc_codegen_ssa[757fe94fec2bb5b4]::back::symbol_export::exported_symbols_provider_local
  22:     0x7fc135e30ca5 - rustc_query_impl[912ffda60ec58dad]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[912ffda60ec58dad]::query_impl::exported_symbols::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 16usize]>>
  23:     0x7fc135e30c63 - <rustc_query_impl[912ffda60ec58dad]::query_impl::exported_symbols::dynamic_query::{closure#2} as core[882c985c10ecc76f]::ops::function::FnOnce<(rustc_middle[6ec8af473b9179e3]::ty::context::TyCtxt, rustc_span[75a95e237d4d0ab1]::def_id::CrateNum)>>::call_once
  24:     0x7fc136a08158 - rustc_query_system[6e8935c22d8afd61]::query::plumbing::try_execute_query::<rustc_query_impl[912ffda60ec58dad]::DynamicConfig<rustc_data_structures[2312d6039bbc2584]::vec_cache::VecCache<rustc_span[75a95e237d4d0ab1]::def_id::CrateNum, rustc_middle[6ec8af473b9179e3]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[6e8935c22d8afd61]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[912ffda60ec58dad]::plumbing::QueryCtxt, false>
  25:     0x7fc136a07cea - rustc_query_impl[912ffda60ec58dad]::query_impl::exported_symbols::get_query_non_incr::__rust_end_short_backtrace
  26:     0x7fc1367c5d1f - <rustc_metadata[5d5d761e43a36ed2]::rmeta::encoder::EncodeContext>::encode_crate_root
  27:     0x7fc136e01e20 - rustc_metadata[5d5d761e43a36ed2]::rmeta::encoder::encode_metadata
  28:     0x7fc136c020b6 - rustc_metadata[5d5d761e43a36ed2]::fs::encode_and_write_metadata
  29:     0x7fc136c00efe - <rustc_interface[dfe6489cec3737ce]::queries::Linker>::codegen_and_build_linker
  30:     0x7fc136c3705d - rustc_interface[dfe6489cec3737ce]::passes::create_and_enter_global_ctxt::<core[882c985c10ecc76f]::option::Option<rustc_interface[dfe6489cec3737ce]::queries::Linker>, rustc_driver_impl[936c1abaea8466f3]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  31:     0x7fc136c29a56 - rustc_interface[dfe6489cec3737ce]::interface::run_compiler::<(), rustc_driver_impl[936c1abaea8466f3]::run_compiler::{closure#0}>::{closure#1}
  32:     0x7fc136abc8d1 - std[5a9fc012e1d0d0b]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[dfe6489cec3737ce]::util::run_in_thread_with_globals<rustc_interface[dfe6489cec3737ce]::util::run_in_thread_pool_with_globals<rustc_interface[dfe6489cec3737ce]::interface::run_compiler<(), rustc_driver_impl[936c1abaea8466f3]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  33:     0x7fc136abcd84 - <<std[5a9fc012e1d0d0b]::thread::Builder>::spawn_unchecked_<rustc_interface[dfe6489cec3737ce]::util::run_in_thread_with_globals<rustc_interface[dfe6489cec3737ce]::util::run_in_thread_pool_with_globals<rustc_interface[dfe6489cec3737ce]::interface::run_compiler<(), rustc_driver_impl[936c1abaea8466f3]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[882c985c10ecc76f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7fc136abe32f - std::sys::pal::unix::thread::Thread::new::thread_start::h88e5d9cbd4733d69
  35:     0x7fc130e97d02 - start_thread
  36:     0x7fc130f173ac - __GI___clone3
  37:                0x0 - <unknown>

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions