Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Clippy panic while getting the span of repr(transparent) #14302

Closed
mathisbot opened this issue Feb 26, 2025 · 1 comment
Closed

Clippy panic while getting the span of repr(transparent) #14302

mathisbot opened this issue Feb 26, 2025 · 1 comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@mathisbot
Copy link

mathisbot commented Feb 26, 2025

Summary

Clippy now panics when trying to find the span of a #[repr(transparent)] attribute.

This error is consistent and happens both on my Windows computer and in my GitHub CI (Linux) (cf. 1, 2, 3 and 4).

Here is the faulty line if needed in the whole file, or here is the related code:

#[repr(transparent)]
pub struct Link<T> {
    next: AtomicPtr<T>,
    _pin: core::marker::PhantomPinned,
}

Also note that clippy succeeded on rustc 1.87.0-nightly (46420c960 2025-02-22) and before.

Version

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

Clippy:
clippy 0.1.86 (85abb27636 2025-02-25)

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, hyperdrive\src\queues\mpsc.rs:137:8: 137:19 (#0))]))
stack backtrace:
 0:     0x7ff83f4065f8 - std::backtrace::Backtrace::create::hb3d94c0bc5bed390
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\std\src\..\..\backtrace\src\backtrace/win64.rs:85:14
 1:     0x7ff83f40654a - std::backtrace::Backtrace::force_capture::he5462ecfb183d038
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\std\src/backtrace.rs:312:9
 2:     0x7fffeba50eec - <alloc[5247b281a230e2b5]::boxed::Box<rustc_driver_impl[ece9314119238800]::install_ice_hook::{closure#1}> as core[33a6731b250746ef]::ops::function::Fn<(&dyn for<'a, 'b> core[33a6731b250746ef]::ops::function::Fn<(&'a std[ea90000577a1704d]::panic::PanicHookInfo<'b>,), Output = ()> + core[33a6731b250746ef]::marker::Sync + core[33a6731b250746ef]::marker::Send, &std[ea90000577a1704d]::panic::PanicHookInfo)>>::call
 3:     0x7ff83f421706 - std::panicking::rust_panic_with_hook::h101eec1151d0c71b
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\alloc\src/boxed.rs:1986:9
 4:     0x7ff83f421452 - std::panicking::begin_panic_handler::{{closure}}::h31c4287def78e79a
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\std\src/panicking.rs:704:13
 5:     0x7ff83f41e0df - std::sys::backtrace::__rust_end_short_backtrace::h4113db6688b2e8fc
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\std\src\sys/backtrace.rs:168:18
 6:     0x7ff83f4210ce - rust_begin_unwind
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\std\src/panicking.rs:695:5
 7:     0x7ff83f46bc11 - core::panicking::panic_fmt::h1b8b73194e4ffa57
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\core\src/panicking.rs:75:14
 8:     0x7ff6f39dcfda - <clippy_lints[53cee459a6c94cae]::macro_use::MacroUseImports as rustc_lint[d60395e09e5d3331]::passes::LateLintPass>::check_attribute
 9:     0x7fffedbb60d5 - <rustc_lint[d60395e09e5d3331]::late::LateContextAndPass<rustc_lint[d60395e09e5d3331]::late::RuntimeCombinedLateLintPass> as rustc_hir[12e9901e10ed55de]::intravisit::Visitor>::visit_nested_item
10:     0x7fffedb2d04c - rustc_hir[12e9901e10ed55de]::intravisit::walk_item::<rustc_lint[d60395e09e5d3331]::late::LateContextAndPass<rustc_lint[d60395e09e5d3331]::late::RuntimeCombinedLateLintPass>>
11:     0x7fffedbb6175 - <rustc_lint[d60395e09e5d3331]::late::LateContextAndPass<rustc_lint[d60395e09e5d3331]::late::RuntimeCombinedLateLintPass> as rustc_hir[12e9901e10ed55de]::intravisit::Visitor>::visit_nested_item
12:     0x7fffedb2d04c - rustc_hir[12e9901e10ed55de]::intravisit::walk_item::<rustc_lint[d60395e09e5d3331]::late::LateContextAndPass<rustc_lint[d60395e09e5d3331]::late::RuntimeCombinedLateLintPass>>
13:     0x7fffedbb6175 - <rustc_lint[d60395e09e5d3331]::late::LateContextAndPass<rustc_lint[d60395e09e5d3331]::late::RuntimeCombinedLateLintPass> as rustc_hir[12e9901e10ed55de]::intravisit::Visitor>::visit_nested_item
14:     0x7fffedbbefdc - rustc_lint[d60395e09e5d3331]::late::check_crate::{closure#0}
15:     0x7fffedbbe747 - rustc_lint[d60395e09e5d3331]::late::check_crate
16:     0x7fffebcb9ac8 - <rustc_session[9077dbfaf668b6d0]::session::Session>::time::<(), rustc_interface[732ac7c3fc8c87d9]::passes::analysis::{closure#0}>
17:     0x7fffebc32cdb - rustc_interface[732ac7c3fc8c87d9]::passes::analysis
18:     0x7fffed79ba9d - rustc_query_impl[b477f66eedaa0f2a]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b477f66eedaa0f2a]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>>
19:     0x7fffed869158 - <rustc_query_impl[b477f66eedaa0f2a]::query_impl::analysis::dynamic_query::{closure#2} as core[33a6731b250746ef]::ops::function::FnOnce<(rustc_middle[91b9b0b98e400ed6]::ty::context::TyCtxt, ())>>::call_once
20:     0x7fffed9bad56 - <rustc_middle[91b9b0b98e400ed6]::dep_graph::DepsType as rustc_query_system[885fed5182497849]::dep_graph::Deps>::with_deps::<<rustc_query_system[885fed5182497849]::dep_graph::graph::DepGraphData<rustc_middle[91b9b0b98e400ed6]::dep_graph::DepsType>>::with_task<(rustc_query_impl[b477f66eedaa0f2a]::plumbing::QueryCtxt, rustc_query_impl[b477f66eedaa0f2a]::DynamicConfig<rustc_query_system[885fed5182497849]::query::caches::SingleCache<rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>>, false, false, false>), (), rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>>::{closure#0}::{closure#0}, rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>>
21:     0x7fffed7a2b92 - <std[ea90000577a1704d]::thread::local::LocalKey<core[33a6731b250746ef]::cell::Cell<*const ()>>>::with::<rustc_middle[91b9b0b98e400ed6]::ty::context::tls::enter_context<rustc_query_system[885fed5182497849]::query::plumbing::execute_job_incr<rustc_query_impl[b477f66eedaa0f2a]::DynamicConfig<rustc_query_system[885fed5182497849]::query::caches::SingleCache<rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b477f66eedaa0f2a]::plumbing::QueryCtxt>::{closure#2}, (rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[885fed5182497849]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>, rustc_query_system[885fed5182497849]::dep_graph::graph::DepNodeIndex)>
22:     0x7fffed6aef4e - rustc_query_system[885fed5182497849]::query::plumbing::try_execute_query::<rustc_query_impl[b477f66eedaa0f2a]::DynamicConfig<rustc_query_system[885fed5182497849]::query::caches::SingleCache<rustc_middle[91b9b0b98e400ed6]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b477f66eedaa0f2a]::plumbing::QueryCtxt, true>
23:     0x7fffed9f730e - rustc_query_impl[b477f66eedaa0f2a]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
24:     0x7fffeba6743a - <std[ea90000577a1704d]::thread::local::LocalKey<core[33a6731b250746ef]::cell::Cell<*const ()>>>::with::<rustc_middle[91b9b0b98e400ed6]::ty::context::tls::enter_context<<rustc_middle[91b9b0b98e400ed6]::ty::context::GlobalCtxt>::enter<rustc_interface[732ac7c3fc8c87d9]::passes::create_and_enter_global_ctxt<core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>, rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}, core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>>::{closure#1}, core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>>::{closure#0}, core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>>
25:     0x7fffeba0b3db - <rustc_middle[91b9b0b98e400ed6]::ty::context::TyCtxt>::create_global_ctxt::<core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>, rustc_interface[732ac7c3fc8c87d9]::passes::create_and_enter_global_ctxt<core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>, rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}>
26:     0x7fffeba073b9 - <rustc_interface[732ac7c3fc8c87d9]::passes::create_and_enter_global_ctxt<core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>, rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core[33a6731b250746ef]::ops::function::FnOnce<(&rustc_session[9077dbfaf668b6d0]::session::Session, rustc_middle[91b9b0b98e400ed6]::ty::context::CurrentGcx, &std[ea90000577a1704d]::sync::once_lock::OnceLock<rustc_middle[91b9b0b98e400ed6]::ty::context::GlobalCtxt>, &rustc_data_structures[9273528566b68323]::sync::worker_local::WorkerLocal<rustc_middle[91b9b0b98e400ed6]::arena::Arena>, &rustc_data_structures[9273528566b68323]::sync::worker_local::WorkerLocal<rustc_hir[12e9901e10ed55de]::Arena>, rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
27:     0x7fffeba062d0 - rustc_interface[732ac7c3fc8c87d9]::passes::create_and_enter_global_ctxt::<core[33a6731b250746ef]::option::Option<rustc_interface[732ac7c3fc8c87d9]::queries::Linker>, rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}::{closure#2}>
28:     0x7fffeba75fb5 - rustc_span[4fb21c680cc2a901]::create_session_globals_then::<(), rustc_interface[732ac7c3fc8c87d9]::util::run_in_thread_with_globals<rustc_interface[732ac7c3fc8c87d9]::util::run_in_thread_pool_with_globals<rustc_interface[732ac7c3fc8c87d9]::interface::run_compiler<(), rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}::{closure#0}>
29:     0x7fffeba8f77b - std[ea90000577a1704d]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[732ac7c3fc8c87d9]::util::run_in_thread_with_globals<rustc_interface[732ac7c3fc8c87d9]::util::run_in_thread_pool_with_globals<rustc_interface[732ac7c3fc8c87d9]::interface::run_compiler<(), rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
30:     0x7fffeba91360 - <<std[ea90000577a1704d]::thread::Builder>::spawn_unchecked_<rustc_interface[732ac7c3fc8c87d9]::util::run_in_thread_with_globals<rustc_interface[732ac7c3fc8c87d9]::util::run_in_thread_pool_with_globals<rustc_interface[732ac7c3fc8c87d9]::interface::run_compiler<(), rustc_driver_impl[ece9314119238800]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[33a6731b250746ef]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
31:     0x7ff83f430a0d - std::sys::pal::windows::thread::Thread::new::thread_start::h0e9977e479463009
                             at /rustc/85abb276361c424d64743c0965242dd0e7b866d1/library\alloc\src/boxed.rs:1972:9
32:     0x7ff8c1ede8d7 - <unknown>
33:     0x7ff8c3edbf2c - <unknown>


rustc version: 1.87.0-nightly (85abb2763 2025-02-25)
platform: x86_64-pc-windows-gnu

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack

@mathisbot mathisbot added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Feb 26, 2025
@y21
Copy link
Member

y21 commented Feb 26, 2025

Looks like the same issue as rust-lang/rust#137640 and has the same backtrace, so closing this one as a duplicate in favor of the one in the rust repo.

@y21 y21 closed this as completed Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

2 participants