Skip to content

ICE: check_attr.rs:368:41: Parsed attributes with longer path not handled by CheckAttrVisitor #143789

Closed
@JonathanBrouwer

Description

@JonathanBrouwer

Code

#[must_use::skip]
fn thing() { }

Meta

rustc --version --verbose:

cargo 1.90.0-nightly (930b4f62c 2025-06-28)
release: 1.90.0-nightly
commit-hash: 930b4f62cfcd1f0eabdb30a56d91bf6844b739bf
commit-date: 2025-06-28
host: x86_64-unknown-linux-gnu
libgit2: 1.9.0 (sys:0.20.2 vendored)
libcurl: 8.12.1-DEV (sys:0.4.80+curl-8.12.1 vendored ssl:OpenSSL/3.5.0)
ssl: OpenSSL 3.5.0 8 Apr 2025
os: Arch Linux Rolling Release [64-bit]

Error output

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `must_use`
 --> src/main.rs:4:3
  |
4 | #[must_use::skip]
  |   ^^^^^^^^ use of unresolved module or unlinked crate `must_use`

error: internal compiler error: compiler/rustc_passes/src/check_attr.rs:368:41: builtin attribute "must_use" not handled by `CheckAttrVisitor`
 --> src/main.rs:4:1
  |
4 | #[must_use::skip]
  | ^^^^^^^^^^^^^^^^^
Backtrace

thread 'rustc' panicked at compiler/rustc_passes/src/check_attr.rs:368:41:
Box<dyn Any>
stack backtrace:
   0:     0x7f3dac135703 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hfe73d8ce579ed9ea
   1:     0x7f3dac802bf7 - core::fmt::write::hb677094ad3ce550f
   2:     0x7f3dac12b343 - std::io::Write::write_fmt::hf90959192a6d2d2c
   3:     0x7f3dac135562 - std::sys::backtrace::BacktraceLock::print::he549be513cb18ae8
   4:     0x7f3dac13905a - std::panicking::default_hook::{{closure}}::hed1573d42aad3039
   5:     0x7f3dac138bdf - std::panicking::default_hook::hbfa7e009b9f449bc
   6:     0x7f3dab210553 - std[d99ba5a7f10fcdad]::panicking::update_hook::<alloc[46b93f97a0e0dc2b]::boxed::Box<rustc_driver_impl[1187c0275bf21a76]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f3dac1398ab - std::panicking::rust_panic_with_hook::h7f3c50ec8496429f
   8:     0x7f3dab24a191 - std[d99ba5a7f10fcdad]::panicking::begin_panic::<rustc_errors[6f835138bb643ba1]::ExplicitBug>::{closure#0}
   9:     0x7f3dab23e6b6 - std[d99ba5a7f10fcdad]::sys::backtrace::__rust_end_short_backtrace::<std[d99ba5a7f10fcdad]::panicking::begin_panic<rustc_errors[6f835138bb643ba1]::ExplicitBug>::{closure#0}, !>
  10:     0x7f3dab23e545 - std[d99ba5a7f10fcdad]::panicking::begin_panic::<rustc_errors[6f835138bb643ba1]::ExplicitBug>
  11:     0x7f3dab253c71 - <rustc_errors[6f835138bb643ba1]::diagnostic::BugAbort as rustc_errors[6f835138bb643ba1]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7f3dab78a3ec - <rustc_errors[6f835138bb643ba1]::DiagCtxtHandle>::span_bug::<rustc_span[eabc74e7902294c4]::span_encoding::Span, alloc[46b93f97a0e0dc2b]::string::String>
  13:     0x7f3dab81f267 - rustc_middle[64bb05ab04415dca]::util::bug::opt_span_bug_fmt::<rustc_span[eabc74e7902294c4]::span_encoding::Span>::{closure#0}
  14:     0x7f3dab7fee8a - rustc_middle[64bb05ab04415dca]::ty::context::tls::with_opt::<rustc_middle[64bb05ab04415dca]::util::bug::opt_span_bug_fmt<rustc_span[eabc74e7902294c4]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  15:     0x7f3dab7fecfb - rustc_middle[64bb05ab04415dca]::ty::context::tls::with_context_opt::<rustc_middle[64bb05ab04415dca]::ty::context::tls::with_opt<rustc_middle[64bb05ab04415dca]::util::bug::opt_span_bug_fmt<rustc_span[eabc74e7902294c4]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  16:     0x7f3da92d47c7 - rustc_middle[64bb05ab04415dca]::util::bug::span_bug_fmt::<rustc_span[eabc74e7902294c4]::span_encoding::Span>
  17:     0x7f3dad3415aa - <rustc_passes[c025b4470439d147]::check_attr::CheckAttrVisitor>::check_attributes
  18:     0x7f3dad33bd9a - <rustc_passes[c025b4470439d147]::check_attr::CheckAttrVisitor as rustc_hir[4526c561771d6ec4]::intravisit::Visitor>::visit_item
  19:     0x7f3dad33b17b - rustc_passes[c025b4470439d147]::check_attr::check_mod_attrs
  20:     0x7f3dad33b025 - rustc_query_impl[e3668e149644d4ae]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e3668e149644d4ae]::query_impl::check_mod_attrs::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64bb05ab04415dca]::query::erase::Erased<[u8; 0usize]>>
  21:     0x7f3dad5fcbdf - rustc_query_system[d392e6bbf8a57d0e]::query::plumbing::try_execute_query::<rustc_query_impl[e3668e149644d4ae]::DynamicConfig<rustc_query_system[d392e6bbf8a57d0e]::query::caches::DefaultCache<rustc_span[eabc74e7902294c4]::def_id::LocalModDefId, rustc_middle[64bb05ab04415dca]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[e3668e149644d4ae]::plumbing::QueryCtxt, true>
  22:     0x7f3dad5fc71c - rustc_query_impl[e3668e149644d4ae]::query_impl::check_mod_attrs::get_query_incr::__rust_end_short_backtrace
  23:     0x7f3dad6013db - <rustc_middle[64bb05ab04415dca]::ty::context::TyCtxt>::par_hir_for_each_module::<rustc_interface[d8a1c992d3fe97ea]::passes::run_required_analyses::{closure#0}::{closure#0}::{closure#1}::{closure#0}>::{closure#0}
  24:     0x7f3dac9f5e59 - rustc_interface[d8a1c992d3fe97ea]::passes::analysis
  25:     0x7f3dac9f5b8b - rustc_query_impl[e3668e149644d4ae]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[e3668e149644d4ae]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[64bb05ab04415dca]::query::erase::Erased<[u8; 0usize]>>
  26:     0x7f3dadabd2c2 - rustc_query_system[d392e6bbf8a57d0e]::query::plumbing::try_execute_query::<rustc_query_impl[e3668e149644d4ae]::DynamicConfig<rustc_query_system[d392e6bbf8a57d0e]::query::caches::SingleCache<rustc_middle[64bb05ab04415dca]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[e3668e149644d4ae]::plumbing::QueryCtxt, true>
  27:     0x7f3dadabcbe3 - rustc_query_impl[e3668e149644d4ae]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  28:     0x7f3dadac6556 - rustc_interface[d8a1c992d3fe97ea]::passes::create_and_enter_global_ctxt::<core[186920d7f2eb1ae1]::option::Option<rustc_interface[d8a1c992d3fe97ea]::queries::Linker>, rustc_driver_impl[1187c0275bf21a76]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  29:     0x7f3dada788c3 - rustc_interface[d8a1c992d3fe97ea]::interface::run_compiler::<(), rustc_driver_impl[1187c0275bf21a76]::run_compiler::{closure#0}>::{closure#1}
  30:     0x7f3dada2b778 - std[d99ba5a7f10fcdad]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[d8a1c992d3fe97ea]::util::run_in_thread_with_globals<rustc_interface[d8a1c992d3fe97ea]::util::run_in_thread_pool_with_globals<rustc_interface[d8a1c992d3fe97ea]::interface::run_compiler<(), rustc_driver_impl[1187c0275bf21a76]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  31:     0x7f3dada2b456 - <<std[d99ba5a7f10fcdad]::thread::Builder>::spawn_unchecked_<rustc_interface[d8a1c992d3fe97ea]::util::run_in_thread_with_globals<rustc_interface[d8a1c992d3fe97ea]::util::run_in_thread_pool_with_globals<rustc_interface[d8a1c992d3fe97ea]::interface::run_compiler<(), rustc_driver_impl[1187c0275bf21a76]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[186920d7f2eb1ae1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  32:     0x7f3dada29a7d - std::sys::pal::unix::thread::Thread::new::thread_start::h4f3bbb27df34bc85
  33:     0x7f3da74a57eb - <unknown>
  34:     0x7f3da752918c - <unknown>
  35:                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 `/home/jonathan/Projects/rust-test/rustc-ice-2025-07-11T13_43_53-3587723.txt` to your bug report

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [check_mod_attrs] checking attributes in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack

Metadata

Metadata

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)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