Closed
Description
Code
//@compile-flags: -C instrument-coverage
fn foo<const N: usize>() {}
core::arch::global_asm!("/* {} */", sym foo::<{
|| {};
0
}>);
fn main() {}
Meta
rustc --version --verbose
:
rustc 1.87.0-nightly (bca5f37cb 2025-02-23)
binary: rustc
commit-hash: bca5f37cbded0db8d37414bb08c4b101a5f26d36
commit-date: 2025-02-23
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0
Error output
Backtrace
warning: unused closure that must be used
--> a.rs:4:5
|
4 | || {};
| ^^^^^
|
= note: closures are lazy and do nothing unless called
= note: `#[warn(unused_must_use)]` on by default
error: internal compiler error: compiler/rustc_symbol_mangling/src/v0.rs:814:17: symbol_names: unexpected DefPathData: GlobalAsm
thread 'rustc' panicked at compiler/rustc_symbol_mangling/src/v0.rs:814:17:
Box<dyn Any>
stack backtrace:
0: 0x7f505f17d024 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hb2766718346e8914
1: 0x7f505f8162ec - core::fmt::write::h9a1616cb06c0cb0c
2: 0x7f5060869851 - std::io::Write::write_fmt::ha495c1f1db9a43ed
3: 0x7f505f17ce82 - std::sys::backtrace::BacktraceLock::print::hfcfc21e91f78122e
4: 0x7f505f17f68e - std::panicking::default_hook::{{closure}}::hdbc3741f9d3f7a84
5: 0x7f505f17f264 - std::panicking::default_hook::hc24bc002e7741aa1
6: 0x7f505e2de2d7 - std[aff040118bb958da]::panicking::update_hook::<alloc[67af6a9cecfd7ba8]::boxed::Box<rustc_driver_impl[301a9b8b79b48566]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7f505f17ff03 - std::panicking::rust_panic_with_hook::hcb6606e9e0388155
8: 0x7f505e319bd1 - std[aff040118bb958da]::panicking::begin_panic::<rustc_errors[ccf3a74766137fa5]::ExplicitBug>::{closure#0}
9: 0x7f505e30dfe6 - std[aff040118bb958da]::sys::backtrace::__rust_end_short_backtrace::<std[aff040118bb958da]::panicking::begin_panic<rustc_errors[ccf3a74766137fa5]::ExplicitBug>::{closure#0}, !>
10: 0x7f505e30dfcb - std[aff040118bb958da]::panicking::begin_panic::<rustc_errors[ccf3a74766137fa5]::ExplicitBug>
11: 0x7f505e3235d1 - <rustc_errors[ccf3a74766137fa5]::diagnostic::BugAbort as rustc_errors[ccf3a74766137fa5]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
12: 0x7f505e8f4846 - rustc_middle[bff44984932adf4f]::util::bug::opt_span_bug_fmt::<rustc_span[2a04d5a35653b919]::span_encoding::Span>::{closure#0}
13: 0x7f505e8ddd2a - rustc_middle[bff44984932adf4f]::ty::context::tls::with_opt::<rustc_middle[bff44984932adf4f]::util::bug::opt_span_bug_fmt<rustc_span[2a04d5a35653b919]::span_encoding::Span>::{closure#0}, !>::{closure#0}
14: 0x7f505e8ddb9b - rustc_middle[bff44984932adf4f]::ty::context::tls::with_context_opt::<rustc_middle[bff44984932adf4f]::ty::context::tls::with_opt<rustc_middle[bff44984932adf4f]::util::bug::opt_span_bug_fmt<rustc_span[2a04d5a35653b919]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
15: 0x7f505ccf9e20 - rustc_middle[bff44984932adf4f]::util::bug::bug_fmt
16: 0x7f505ee352de - <rustc_symbol_mangling[4df9e5f33cffabe4]::v0::SymbolMangler as rustc_middle[bff44984932adf4f]::ty::print::Printer>::print_def_path
17: 0x7f505ee35193 - <rustc_symbol_mangling[4df9e5f33cffabe4]::v0::SymbolMangler as rustc_middle[bff44984932adf4f]::ty::print::Printer>::print_def_path
18: 0x7f505ee35193 - <rustc_symbol_mangling[4df9e5f33cffabe4]::v0::SymbolMangler as rustc_middle[bff44984932adf4f]::ty::print::Printer>::print_def_path
19: 0x7f505ee3461c - rustc_symbol_mangling[4df9e5f33cffabe4]::v0::mangle
20: 0x7f505ffca8c9 - rustc_symbol_mangling[4df9e5f33cffabe4]::symbol_name_provider
21: 0x7f505ffc93ea - rustc_query_impl[5384b6942a4aabb2]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[5384b6942a4aabb2]::query_impl::symbol_name::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bff44984932adf4f]::query::erase::Erased<[u8; 16usize]>>
22: 0x7f505ffc83c1 - rustc_query_system[5043f4129a32abe7]::query::plumbing::try_execute_query::<rustc_query_impl[5384b6942a4aabb2]::DynamicConfig<rustc_query_system[5043f4129a32abe7]::query::caches::DefaultCache<rustc_middle[bff44984932adf4f]::ty::instance::Instance, rustc_middle[bff44984932adf4f]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[5384b6942a4aabb2]::plumbing::QueryCtxt, false>
23: 0x7f505ffc801e - rustc_query_impl[5384b6942a4aabb2]::query_impl::symbol_name::get_query_non_incr::__rust_end_short_backtrace
24: 0x7f506067e784 - rustc_middle[bff44984932adf4f]::query::plumbing::query_get_at::<rustc_query_system[5043f4129a32abe7]::query::caches::DefaultCache<rustc_middle[bff44984932adf4f]::ty::instance::Instance, rustc_middle[bff44984932adf4f]::query::erase::Erased<[u8; 16usize]>>>
25: 0x7f505e166dcf - rustc_codegen_llvm[c101bf8584bfcdb2]::coverageinfo::mapgen::covfun::prepare_covfun_record
26: 0x7f5060726995 - rustc_codegen_llvm[c101bf8584bfcdb2]::base::compile_codegen_unit::module_codegen
27: 0x7f50608eb750 - <rustc_codegen_llvm[c101bf8584bfcdb2]::LlvmCodegenBackend as rustc_codegen_ssa[9aaafa5d25c08f19]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
28: 0x7f50608e7951 - <rustc_codegen_llvm[c101bf8584bfcdb2]::LlvmCodegenBackend as rustc_codegen_ssa[9aaafa5d25c08f19]::traits::backend::CodegenBackend>::codegen_crate
29: 0x7f50606ba9db - <rustc_interface[a6a17d2a4de965ee]::queries::Linker>::codegen_and_build_linker
30: 0x7f506094e1ef - rustc_interface[a6a17d2a4de965ee]::passes::create_and_enter_global_ctxt::<core[25dd51937c36d244]::option::Option<rustc_interface[a6a17d2a4de965ee]::queries::Linker>, rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
31: 0x7f5060941a60 - rustc_interface[a6a17d2a4de965ee]::interface::run_compiler::<(), rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}>::{closure#1}
32: 0x7f506077eedc - std[aff040118bb958da]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_with_globals<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_pool_with_globals<rustc_interface[a6a17d2a4de965ee]::interface::run_compiler<(), rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
33: 0x7f506077f300 - <<std[aff040118bb958da]::thread::Builder>::spawn_unchecked_<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_with_globals<rustc_interface[a6a17d2a4de965ee]::util::run_in_thread_pool_with_globals<rustc_interface[a6a17d2a4de965ee]::interface::run_compiler<(), rustc_driver_impl[301a9b8b79b48566]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[25dd51937c36d244]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
34: 0x7f506077fceb - std::sys::pal::unix::thread::Thread::new::thread_start::h4bc285b173c402c8
35: 0x7f505aaa370a - <unknown>
36: 0x7f505ab27aac - <unknown>
37: 0x0 - <unknown>
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: please make sure that you have updated to the latest nightly
note: please attach the file at `/tmp/im2/rustc-ice-2025-02-23T09_43_35-2986648.txt` to your bug report
note: compiler flags: -C instrument-coverage
query stack during panic:
#0 [symbol_name] computing the symbol for `{global_asm#0}::{constant#0}::{closure#0}`
end of query stack
error: aborting due to 1 previous error; 1 warning emitted