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

macro_use_imports implementation ICE #14296

Closed
yhx-12243 opened this issue Feb 26, 2025 · 1 comment
Closed

macro_use_imports implementation ICE #14296

yhx-12243 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

@yhx-12243
Copy link

Summary

Code:

#![warn(clippy::macro_use_imports)]

#[repr(transparent)]
struct Foo(String);

fn main() {
}

cf. #14295

Version

rustc 1.87.0-nightly (85abb2763 2025-02-25)
binary: rustc
commit-hash: 85abb276361c424d64743c0965242dd0e7b866d1
commit-date: 2025-02-25
host: aarch64-apple-darwin
release: 1.87.0-nightly
LLVM version: 20.1.0

Error output

Backtrace

warning: struct `Foo` is never constructed
--> 1.rs:4:8
|
4 | struct Foo(String);
|        ^^^
|
= note: `#[warn(dead_code)]` on by default


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, 1.rs:3:8: 3:19 (#0))]))
stack backtrace:
 0: _rust_begin_unwind
 1: core::panicking::panic_fmt
 2: <clippy_lints::macro_use::MacroUseImports as rustc_lint::passes::LateLintPass>::check_attribute
 3: <rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>::with_lint_attrs::<<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass> as rustc_hir::intravisit::Visitor>::visit_item::{closure#0}>
 4: rustc_hir::intravisit::walk_mod::<rustc_lint::late::LateContextAndPass<rustc_lint::late::RuntimeCombinedLateLintPass>>
 5: rustc_lint::late::check_crate::{closure#0}
 6: rustc_lint::late::check_crate
 7: rustc_interface::passes::analysis
    [... omitted 1 frame ...]
 8: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>
 9: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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 `/private/tmp/rustc-ice-2025-02-26T02_44_19-99705.txt` to your bug report

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)

warning: 1 warning emitted

rustc-ice-2025-02-26T02_44_19-99705.txt

@yhx-12243 yhx-12243 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 rust-lang/rust#137640

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