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

Panic on cargo clippy 1.87.0-nightly (1d1d646c0 2025-02-21) #14312

Closed
pv42 opened this issue Feb 27, 2025 · 1 comment
Closed

Panic on cargo clippy 1.87.0-nightly (1d1d646c0 2025-02-21) #14312

pv42 opened this issue Feb 27, 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

@pv42
Copy link

pv42 commented Feb 27, 2025

Summary

Code around the location indicated by the crash (exact crashing characters are 'u8'):

use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[derive(Deserialize_repr, Serialize_repr, Debug)]
#[repr(u8)]
pub enum Action {
    /// turn off
    Off = 0,
    /// turn on
    On = 1,
    /// 
    ShortOff = 2,
    /// 
    ShortOn = 3,
    /// 
    Toggle = 4,
    /// 
    NoChange = 5,
    /// 
    Ignored = 6,
}

Bug does not occur on the prior version or on stable 1.85.0.
compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

Version

rustc 1.87.0-nightly (00f245915 2025-02-26)
binary: rustc
commit-hash: 00f245915b0c7839d42c26f9628220c4f1b93bf6
commit-date: 2025-02-26
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0

Error output

Backtrace

thread 'rustc' panicked at /rustc/00f245915b0c7839d42c26f9628220c4f1b93bf6/compiler/rustc_hir/src/hir.rs:1165:18:
can't get the span of an arbitrary parsed attribute: Parsed(Repr([(ReprInt(UnsignedInt(U8)), src/[redacted].rs:19:8: 19:10 (#0))]))
stack backtrace:
 0:     0x73f0a462fe25 - std::backtrace::Backtrace::create::h1e3c43ff134d0a33
 1:     0x73f0a29af2a5 - std::backtrace::Backtrace::force_capture::h75965a4aa80bbf9e
 2:     0x73f0a1b242fe - std[63ccf99907648090]::panicking::update_hook::<alloc[40f330a4b1dfe34e]::boxed::Box<rustc_driver_impl[44d86c3fd4736e11]::install_ice_hook::{closure#1}>>::{closure#0}
 3:     0x73f0a29c79d3 - std::panicking::rust_panic_with_hook::hc531b406179c95b0
 4:     0x73f0a29c76ca - std::panicking::begin_panic_handler::{{closure}}::hcdc071f581557557
 5:     0x73f0a29c4f89 - std::sys::backtrace::__rust_end_short_backtrace::h0fbed5a87d7f358d
 6:     0x73f0a29c738d - rust_begin_unwind
 7:     0x73f09f659d50 - core::panicking::panic_fmt::h459d961e1d0721af
 8:     0x60a4489ee699 - <clippy_lints[fa263d50b990e5dd]::macro_use::MacroUseImports as rustc_lint[462e4f7eae09b0af]::passes::LateLintPass>::check_attribute
 9:     0x73f0a200c606 - <rustc_lint[462e4f7eae09b0af]::late::LateContextAndPass<rustc_lint[462e4f7eae09b0af]::late::RuntimeCombinedLateLintPass> as rustc_hir[d00047872d62e706]::intravisit::Visitor>::visit_nested_item
10:     0x73f0a200c820 - <rustc_lint[462e4f7eae09b0af]::late::LateContextAndPass<rustc_lint[462e4f7eae09b0af]::late::RuntimeCombinedLateLintPass> as rustc_hir[d00047872d62e706]::intravisit::Visitor>::visit_nested_item
11:     0x73f0a428e7cb - rustc_lint[462e4f7eae09b0af]::late::check_crate::{closure#0}
12:     0x73f0a428eaab - rustc_lint[462e4f7eae09b0af]::late::check_crate
13:     0x73f0a4292432 - rustc_interface[e696fb279c73d43f]::passes::analysis
14:     0x73f0a4292219 - rustc_query_impl[14741ea0e0b48805]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[14741ea0e0b48805]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[fe836999645634e1]::query::erase::Erased<[u8; 0usize]>>
15:     0x73f0a428daea - rustc_query_system[964dfde9a4346c01]::query::plumbing::try_execute_query::<rustc_query_impl[14741ea0e0b48805]::DynamicConfig<rustc_query_system[964dfde9a4346c01]::query::caches::SingleCache<rustc_middle[fe836999645634e1]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[14741ea0e0b48805]::plumbing::QueryCtxt, true>
16:     0x73f0a428d4e2 - rustc_query_impl[14741ea0e0b48805]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
17:     0x73f0a433777c - rustc_interface[e696fb279c73d43f]::passes::create_and_enter_global_ctxt::<core[e205c6c2c408574d]::option::Option<rustc_interface[e696fb279c73d43f]::queries::Linker>, rustc_driver_impl[44d86c3fd4736e11]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
18:     0x73f0a43282e0 - rustc_interface[e696fb279c73d43f]::interface::run_compiler::<(), rustc_driver_impl[44d86c3fd4736e11]::run_compiler::{closure#0}>::{closure#1}
19:     0x73f0a41aedc8 - std[63ccf99907648090]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[e696fb279c73d43f]::util::run_in_thread_with_globals<rustc_interface[e696fb279c73d43f]::util::run_in_thread_pool_with_globals<rustc_interface[e696fb279c73d43f]::interface::run_compiler<(), rustc_driver_impl[44d86c3fd4736e11]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
20:     0x73f0a41af574 - <<std[63ccf99907648090]::thread::Builder>::spawn_unchecked_<rustc_interface[e696fb279c73d43f]::util::run_in_thread_with_globals<rustc_interface[e696fb279c73d43f]::util::run_in_thread_pool_with_globals<rustc_interface[e696fb279c73d43f]::interface::run_compiler<(), rustc_driver_impl[44d86c3fd4736e11]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[e205c6c2c408574d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
21:     0x73f0a41b0a6f - std::sys::pal::unix::thread::Thread::new::thread_start::h8f2a48bb719a6902
22:     0x73f09e094ac3 - start_thread
                             at ./nptl/pthread_create.c:442:8
23:     0x73f09e126850 - __GI___clone3
                             at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81:0
24:                0x0 - <unknown>


rustc version: 1.87.0-nightly (00f245915 2025-02-26)
platform: x86_64-unknown-linux-gnu

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

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

flip1995 commented Feb 27, 2025

Duplicate of pinned issue #14303

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