Skip to content

macro_use_imports ICE: can't get the span of an arbitrary parsed attribute: ... #14303

Closed
@DaniPopes

Description

@DaniPopes

Summary

Found in CI here

Playground

#![warn(clippy::macro_use_imports)]

#[repr(transparent)]
pub struct X(());

Version

rustc 1.87.0-nightly (85abb2763 2025-02-25)
binary: rustc
commit-hash: 85abb276361c424d64743c0965242dd0e7b866d1
commit-date: 2025-02-25
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Error output

Backtrace

thread 'rustc' panicked at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/compiler/rustc_hir/src/hir.rs:1165:18:
can't get the span of an arbitrary parsed attribute: Parsed(Repr([(ReprTransparent, src/lib.rs:5:8: 5:19 (#0))]))
stack backtrace:
 0:     0x7cd70e9b4864 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hfbcadcb664e1e745
 1:     0x7cd70f21622c - core::fmt::write::h96d3ad630dab013b
 2:     0x7cd7102683d1 - std::io::Write::write_fmt::h3607b096b8efb3ee
 3:     0x7cd70e9b46c2 - std::sys::backtrace::BacktraceLock::print::h5c5089ef3846b40c
 4:     0x7cd70e9b6ece - std::panicking::default_hook::{{closure}}::ha2f1ea5200a78a69
 5:     0x7cd70e9b6aa4 - std::panicking::default_hook::he72a4c09abcc8836
 6:     0x7cd70db1c4a7 - std[fe011135ce22c601]::panicking::update_hook::<alloc[d9798e16cf59ec93]::boxed::Box<rustc_driver_impl[685633a5d1c26086]::install_ice_hook::{closure#1}>>::{closure#0}
 7:     0x7cd70e9b7743 - std::panicking::rust_panic_with_hook::h9c6e02ac63684bb2
 8:     0x7cd70e9b743a - std::panicking::begin_panic_handler::{{closure}}::h408c429dfb442e49
 9:     0x7cd70e9b4d39 - std::sys::backtrace::__rust_end_short_backtrace::h7f67e94cbe910959
10:     0x7cd70e9b70fd - rust_begin_unwind
11:     0x7cd70b658430 - core::panicking::panic_fmt::h66d01c76cbf68b4b
12:     0x5de305c93609 - <clippy_lints[5cffcd3e2f791c9d]::macro_use::MacroUseImports as rustc_lint[b946cbde2b0541cb]::passes::LateLintPass>::check_attribute
13:     0x7cd70e005b46 - <rustc_lint[b946cbde2b0541cb]::late::LateContextAndPass<rustc_lint[b946cbde2b0541cb]::late::RuntimeCombinedLateLintPass> as rustc_hir[8d893940beefe6b3]::intravisit::Visitor>::visit_nested_item
14:     0x7cd71026090b - rustc_lint[b946cbde2b0541cb]::late::check_crate::{closure#0}
15:     0x7cd710260beb - rustc_lint[b946cbde2b0541cb]::late::check_crate
16:     0x7cd710264572 - rustc_interface[6c13097cf9f19f86]::passes::analysis
17:     0x7cd710264359 - rustc_query_impl[34908cfd77543239]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[34908cfd77543239]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[5ffae1726b14730a]::query::erase::Erased<[u8; 0usize]>>
18:     0x7cd710309d4b - rustc_query_system[fc2137a045893525]::query::plumbing::try_execute_query::<rustc_query_impl[34908cfd77543239]::DynamicConfig<rustc_query_system[fc2137a045893525]::query::caches::SingleCache<rustc_middle[5ffae1726b14730a]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[34908cfd77543239]::plumbing::QueryCtxt, false>
19:     0x7cd710309a39 - rustc_query_impl[34908cfd77543239]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
20:     0x7cd7102df0fc - rustc_interface[6c13097cf9f19f86]::passes::create_and_enter_global_ctxt::<core[5ec1fcc0a718fbac]::option::Option<rustc_interface[6c13097cf9f19f86]::queries::Linker>, rustc_driver_impl[685633a5d1c26086]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
21:     0x7cd7102d29e0 - rustc_interface[6c13097cf9f19f86]::interface::run_compiler::<(), rustc_driver_impl[685633a5d1c26086]::run_compiler::{closure#0}>::{closure#1}
22:     0x7cd71015e8c8 - std[fe011135ce22c601]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[6c13097cf9f19f86]::util::run_in_thread_with_globals<rustc_interface[6c13097cf9f19f86]::util::run_in_thread_pool_with_globals<rustc_interface[6c13097cf9f19f86]::interface::run_compiler<(), rustc_driver_impl[685633a5d1c26086]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
23:     0x7cd71015f074 - <<std[fe011135ce22c601]::thread::Builder>::spawn_unchecked_<rustc_interface[6c13097cf9f19f86]::util::run_in_thread_with_globals<rustc_interface[6c13097cf9f19f86]::util::run_in_thread_pool_with_globals<rustc_interface[6c13097cf9f19f86]::interface::run_compiler<(), rustc_driver_impl[685633a5d1c26086]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[5ec1fcc0a718fbac]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
24:     0x7cd71016056b - std::sys::pal::unix::thread::Thread::new::thread_start::h3ad2c4029bc451ad
25:     0x7cd70a28aa94 - <unknown>
26:     0x7cd70a317a34 - clone
27:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust-clippy/issues/new?template=ice.yml

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/playground/rustc-ice-2025-02-26T19_57_33-20.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

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

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
note: Clippy version: clippy 0.1.86 (85abb27636 2025-02-25)

error: could not compile `playground` (lib)

Caused by:
process didn't exit successfully: ... (exit status: 101)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions