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

ice: upper case acronyms, unnamed_fields #12284

Closed
matthiaskrgr opened this issue Feb 12, 2024 · 0 comments · Fixed by #12903
Closed

ice: upper case acronyms, unnamed_fields #12284

matthiaskrgr opened this issue Feb 12, 2024 · 0 comments · Fixed by #12903
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 12, 2024

Summary

requires rust-lang/rust#115367

#![allow(incomplete_features)]
#![feature(unnamed_fields)]

#[repr(C)]
struct Foo {
    _: struct {
    },
}


fn main() {}

Version

rustc 1.78.0-nightly (b381d3ab2 2024-02-12)
binary: rustc
commit-hash: b381d3ab27f788f990551100c4425bb782d26d76
commit-date: 2024-02-12
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 17.0.6

Error output

Backtrace

warning: struct `Foo` is never constructed
--> field_access.rs:9:8
|
9 | struct Foo {
|        ^^^
|
= note: `#[warn(dead_code)]` on by default

thread 'rustc' panicked at src/tools/clippy/clippy_lints/src/upper_case_acronyms.rs:66:46:
called `Option::unwrap()` on a `None` value
stack backtrace:
 0:     0x7fba2179b476 - std::backtrace_rs::backtrace::libunwind::trace::h3f288a3148e8bb15
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
 1:     0x7fba2179b476 - std::backtrace_rs::backtrace::trace_unsynchronized::h7277353061928bc0
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x7fba2179b476 - std::sys_common::backtrace::_print_fmt::hbf79f06a8c92ca0e
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/sys_common/backtrace.rs:68:5
 3:     0x7fba2179b476 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h0afd1ff8e38a8a84
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/sys_common/backtrace.rs:44:22
 4:     0x7fba217ee030 - core::fmt::rt::Argument::fmt::h7f26a9b6a6522b09
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/core/src/fmt/rt.rs:142:9
 5:     0x7fba217ee030 - core::fmt::write::he7de9de816f98016
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/core/src/fmt/mod.rs:1120:17
 6:     0x7fba2178ec6f - std::io::Write::write_fmt::h38e65bf4265dc66c
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/io/mod.rs:1854:15
 7:     0x7fba2179b254 - std::sys_common::backtrace::_print::hf1424a842a74edeb
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/sys_common/backtrace.rs:47:5
 8:     0x7fba2179b254 - std::sys_common::backtrace::print::hbb43acdb160822bd
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/sys_common/backtrace.rs:34:9
 9:     0x7fba2179e047 - std::panicking::default_hook::{{closure}}::h9c602a562527e529
10:     0x7fba2179dda9 - std::panicking::default_hook::h9cb3bf5f6c73326f
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/panicking.rs:292:9
11:     0x7fba1e55cfdc - std[73253c920228642]::panicking::update_hook::<alloc[940273873142bb35]::boxed::Box<rustc_driver_impl[f037f419b039420a]::install_ice_hook::{closure#0}>>::{closure#0}
12:     0x7fba2179e796 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h1e0fe9ec90d27cc3
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/alloc/src/boxed.rs:2030:9
13:     0x7fba2179e796 - std::panicking::rust_panic_with_hook::hb5ad56797fd964c4
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/panicking.rs:785:13
14:     0x7fba2179e4a9 - std::panicking::begin_panic_handler::{{closure}}::hd364aeee29433213
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/panicking.rs:651:13
15:     0x7fba2179b976 - std::sys_common::backtrace::__rust_end_short_backtrace::ha10bb1568b9ec73d
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/sys_common/backtrace.rs:171:18
16:     0x7fba2179e234 - rust_begin_unwind
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/panicking.rs:647:5
17:     0x7fba217ea785 - core::panicking::panic_fmt::h91fa7152f33c7717
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/core/src/panicking.rs:72:14
18:     0x7fba217ea843 - core::panicking::panic::hd1dee23cbb6390f9
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/core/src/panicking.rs:144:5
19:     0x7fba217ea516 - core::option::unwrap_failed::h8567a40948315a82
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/core/src/option.rs:1983:5
20:     0x55e09361b7bc - clippy_lints[131ede36f98d4442]::upper_case_acronyms::check_ident
21:     0x7fba1e8d2c7e - <rustc_lint[f6359b7d3f6d639b]::late::LateContextAndPass<rustc_lint[f6359b7d3f6d639b]::late::RuntimeCombinedLateLintPass> as rustc_hir[6019942fb8e590f1]::intravisit::Visitor>::visit_item
22:     0x7fba1e8d4ee7 - <rustc_lint[f6359b7d3f6d639b]::late::LateContextAndPass<rustc_lint[f6359b7d3f6d639b]::late::RuntimeCombinedLateLintPass> as rustc_hir[6019942fb8e590f1]::intravisit::Visitor>::visit_variant_data
23:     0x7fba1e8d3135 - <rustc_lint[f6359b7d3f6d639b]::late::LateContextAndPass<rustc_lint[f6359b7d3f6d639b]::late::RuntimeCombinedLateLintPass> as rustc_hir[6019942fb8e590f1]::intravisit::Visitor>::visit_item
24:     0x7fba1e8d505a - <rustc_lint[f6359b7d3f6d639b]::late::LateContextAndPass<rustc_lint[f6359b7d3f6d639b]::late::RuntimeCombinedLateLintPass> as rustc_hir[6019942fb8e590f1]::intravisit::Visitor>::visit_mod
25:     0x7fba202f012b - rustc_lint[f6359b7d3f6d639b]::late::check_crate::{closure#0}
26:     0x7fba202f0409 - rustc_lint[f6359b7d3f6d639b]::late::check_crate
27:     0x7fba201e13d2 - rustc_interface[ceb207a8fb5539d]::passes::analysis
28:     0x7fba201e005f - rustc_query_impl[b78e7f0549dc02d3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b78e7f0549dc02d3]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[dbb6cff8550fbced]::query::erase::Erased<[u8; 1usize]>>
29:     0x7fba206c6064 - rustc_query_system[74854bfa6cddafab]::query::plumbing::try_execute_query::<rustc_query_impl[b78e7f0549dc02d3]::DynamicConfig<rustc_query_system[74854bfa6cddafab]::query::caches::SingleCache<rustc_middle[dbb6cff8550fbced]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[b78e7f0549dc02d3]::plumbing::QueryCtxt, false>
30:     0x7fba206c5dc7 - rustc_query_impl[b78e7f0549dc02d3]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
31:     0x7fba205409fb - rustc_interface[ceb207a8fb5539d]::interface::run_compiler::<core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>, rustc_driver_impl[f037f419b039420a]::run_compiler::{closure#0}>::{closure#0}
32:     0x7fba2076ef12 - std[73253c920228642]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ceb207a8fb5539d]::util::run_in_thread_with_globals<rustc_interface[ceb207a8fb5539d]::util::run_in_thread_pool_with_globals<rustc_interface[ceb207a8fb5539d]::interface::run_compiler<core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>, rustc_driver_impl[f037f419b039420a]::run_compiler::{closure#0}>::{closure#0}, core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>>::{closure#0}, core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>>
33:     0x7fba2076ed3e - <<std[73253c920228642]::thread::Builder>::spawn_unchecked_<rustc_interface[ceb207a8fb5539d]::util::run_in_thread_with_globals<rustc_interface[ceb207a8fb5539d]::util::run_in_thread_pool_with_globals<rustc_interface[ceb207a8fb5539d]::interface::run_compiler<core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>, rustc_driver_impl[f037f419b039420a]::run_compiler::{closure#0}>::{closure#0}, core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>>::{closure#0}, core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ed182bbac36ed604]::result::Result<(), rustc_span[a4806a91d128f927]::ErrorGuaranteed>>::{closure#1} as core[ed182bbac36ed604]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
34:     0x7fba217a7985 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h37d86e7af57ec8cf
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/alloc/src/boxed.rs:2016:9
35:     0x7fba217a7985 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h99a2218ed45ac1ce
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/alloc/src/boxed.rs:2016:9
36:     0x7fba217a7985 - std::sys::pal::unix::thread::Thread::new::thread_start::h6344e9d30547345d
                             at /rustc/b381d3ab27f788f990551100c4425bb782d26d76/library/std/src/sys/pal/unix/thread.rs:108:17
37:     0x7fba1b5879eb - <unknown>
38:     0x7fba1b60b7cc - <unknown>
39:                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 attach the file at `/tmp/im/rustc-ice-2024-02-12T20_21_49-984495.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.78 (b381d3a 2024-02-12)

warning: 1 warning emitted

@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Feb 12, 2024
@matthiaskrgr matthiaskrgr changed the title ice: upper case acronyms, `unnamed_fields ice: upper case acronyms, unnamed_fields Feb 12, 2024
@bors bors closed this as completed in 0625183 Jun 17, 2024
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

Successfully merging a pull request may close this issue.

1 participant