Skip to content
New issue

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

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

Already on GitHub? # to your account

diagnostic_namespace was not listed in declare_features ICE #122446

Closed
CraZySacX opened this issue Mar 13, 2024 · 8 comments · Fixed by #122482
Closed

diagnostic_namespace was not listed in declare_features ICE #122446

CraZySacX opened this issue Mar 13, 2024 · 8 comments · Fixed by #122482
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@CraZySacX
Copy link

Summary

When compiling my unstable feature and diagnostic_namespace is included I got the attached ICE.

The following is the unstable configuration

#![cfg_attr(
    all(feature = "unstable", nightly),
    feature(
        diagnostic_namespace,
        lint_reasons,
        multiple_supertrait_upcastable,
        must_not_suspend,
        non_exhaustive_omitted_patterns_lint,
        rustdoc_missing_doc_code_examples,
        strict_provenance,
        type_privacy_lints,
    )
)]

https://github.com/rustyhorde/pud is the repository this occurs on. I will get a minimal verifiable example setup shortly.

Version

rustc 1.78.0-nightly (a165f1f65 2024-03-12)
binary: rustc
commit-hash: a165f1f65015b1bd4afd2ec50700aaacf2e0c485
commit-date: 2024-03-12
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Error output

Backtrace

thread 'rustc' panicked at compiler/rustc_feature/src/unstable.rs:172:1:
`diagnostic_namespace` was not listed in `declare_features`
stack backtrace:
 0:     0x71d0020346cf - std::backtrace_rs::backtrace::libunwind::trace::h62f3b47628dd17b6
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
 1:     0x71d0020346cf - std::backtrace_rs::backtrace::trace_unsynchronized::hf69f72db4a833c5a
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x71d0020346cf - std::backtrace::Backtrace::create::hde75383bf24709d3
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/backtrace.rs:331:13
 3:     0x71d002034610 - std::backtrace::Backtrace::force_capture::he76315b7b93186cf
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/backtrace.rs:312:9
 4:     0x71cffeaa7e84 - std[d99a67f26152ed04]::panicking::update_hook::<alloc[3da730520fd9e9f]::boxed::Box<rustc_driver_impl[32be582443c69875]::install_ice_hook::{closure#0}>>::{closure#0}
 5:     0x71d00204f930 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h3123ef48483f5a9f
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/alloc/src/boxed.rs:2034:9
 6:     0x71d00204f930 - std::panicking::rust_panic_with_hook::hc8ea6fc0780cadf2
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/panicking.rs:783:13
 7:     0x71d00204f672 - std::panicking::begin_panic_handler::{{closure}}::hbadcf855f0ac336d
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/panicking.rs:657:13
 8:     0x71d00204cbc6 - std::sys_common::backtrace::__rust_end_short_backtrace::hd709bf062ed2b8bd
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/sys_common/backtrace.rs:171:18
 9:     0x71d00204f3a4 - rust_begin_unwind
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/panicking.rs:645:5
10:     0x71d002099d15 - core::panicking::panic_fmt::hc88aa6bdd27ff112
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/core/src/panicking.rs:72:14
11:     0x71d00155e263 - <rustc_feature[435d5b53c86da6fd]::unstable::Features>::active.cold.0
12:     0x71cfffe2c1d6 - <rustc_lint[16f6928cb0a24f44]::levels::LintLevelsBuilder<rustc_lint[16f6928cb0a24f44]::levels::TopDown>>::check_gated_lint
13:     0x71cfffe2a7d0 - <rustc_lint[16f6928cb0a24f44]::levels::LintLevelsBuilder<rustc_lint[16f6928cb0a24f44]::levels::TopDown>>::push
14:     0x71cffedabd69 - rustc_lint[16f6928cb0a24f44]::early::check_ast_node_inner::<rustc_lint[16f6928cb0a24f44]::early::RuntimeCombinedEarlyLintPass, (&rustc_ast[b2baecc575d35278]::ast::Crate, &[rustc_ast[b2baecc575d35278]::ast::Attribute])>
15:     0x71d000759c79 - rustc_interface[d25bff95c4ca47a9]::passes::resolver_for_lowering_raw
16:     0x71d00075844d - rustc_query_impl[583025ad343be4b9]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[583025ad343be4b9]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2167abb34cd9315b]::query::erase::Erased<[u8; 16usize]>>
17:     0x71d00075842d - <rustc_query_impl[583025ad343be4b9]::query_impl::resolver_for_lowering_raw::dynamic_query::{closure#2} as core[d2efe8fd8090ae32]::ops::function::FnOnce<(rustc_middle[2167abb34cd9315b]::ty::context::TyCtxt, ())>>::call_once
18:     0x71d0009b380e - rustc_query_system[a066d69301dbd3df]::query::plumbing::try_execute_query::<rustc_query_impl[583025ad343be4b9]::DynamicConfig<rustc_query_system[a066d69301dbd3df]::query::caches::SingleCache<rustc_middle[2167abb34cd9315b]::query::erase::Erased<[u8; 16usize]>>, false, false, false>, rustc_query_impl[583025ad343be4b9]::plumbing::QueryCtxt, true>
19:     0x71d0009b453b - rustc_query_impl[583025ad343be4b9]::query_impl::resolver_for_lowering_raw::get_query_incr::__rust_end_short_backtrace
20:     0x71d000df2ced - rustc_interface[d25bff95c4ca47a9]::interface::run_compiler::<core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>, rustc_driver_impl[32be582443c69875]::run_compiler::{closure#0}>::{closure#0}
21:     0x71d000deb217 - std[d99a67f26152ed04]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[d25bff95c4ca47a9]::util::run_in_thread_with_globals<rustc_interface[d25bff95c4ca47a9]::util::run_in_thread_pool_with_globals<rustc_interface[d25bff95c4ca47a9]::interface::run_compiler<core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>, rustc_driver_impl[32be582443c69875]::run_compiler::{closure#0}>::{closure#0}, core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>>::{closure#0}, core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>>
22:     0x71d000deb044 - <<std[d99a67f26152ed04]::thread::Builder>::spawn_unchecked_<rustc_interface[d25bff95c4ca47a9]::util::run_in_thread_with_globals<rustc_interface[d25bff95c4ca47a9]::util::run_in_thread_pool_with_globals<rustc_interface[d25bff95c4ca47a9]::interface::run_compiler<core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>, rustc_driver_impl[32be582443c69875]::run_compiler::{closure#0}>::{closure#0}, core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>>::{closure#0}, core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d2efe8fd8090ae32]::result::Result<(), rustc_span[7af1910a94d968b0]::ErrorGuaranteed>>::{closure#1} as core[d2efe8fd8090ae32]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
23:     0x71d002059135 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h5044a91960b98ce7
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/alloc/src/boxed.rs:2020:9
24:     0x71d002059135 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcd8b5448afe6ea4e
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/alloc/src/boxed.rs:2020:9
25:     0x71d002059135 - std::sys::pal::unix::thread::Thread::new::thread_start::hd4b31b2f3db552cc
                             at /rustc/a165f1f65015b1bd4afd2ec50700aaacf2e0c485/library/std/src/sys/pal/unix/thread.rs:108:17
26:     0x71cffbaa955a - <unknown>
27:     0x71cffbb26a3c - <unknown>
28:                0x0 - <unknown>


rustc version: 1.78.0-nightly (a165f1f65 2024-03-12)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [resolver_for_lowering_raw] getting the resolver for lowering
end of query stack

@CraZySacX CraZySacX added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Mar 13, 2024
@CraZySacX
Copy link
Author

Here is the full ICE output:

rustc-ice-2024-03-13T16_44_18-316116.txt

@CraZySacX
Copy link
Author

CraZySacX commented Mar 13, 2024

Turns out I was missing diagnostic_namespace in my deny list. Not sure if that should be an ICE or not, feel free to close if that is expected behavior.

This wasn't a fix, the behavior still happened.

@y21
Copy link
Member

y21 commented Mar 13, 2024

Does this specifically only happen with clippy, or does this ICE also happen with a regular cargo check/cargo build? The backtrace and the fact that these are all rustc lints/features makes me think it's a bug in the compiler

@CraZySacX
Copy link
Author

cargo check and cargo build both produce the same ICE.

@y21
Copy link
Member

y21 commented Mar 13, 2024

Moving to rust-lang/rust in that case, since it sounds like fixing this requires changes in the compiler and we can't do much about that on the clippy side

@y21 y21 transferred this issue from rust-lang/rust-clippy Mar 13, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 13, 2024
@GrigorenkoPV
Copy link
Contributor

GrigorenkoPV commented Mar 13, 2024

From what I can tell, MCVE is

#![deny(unknown_or_malformed_diagnostic_attributes)]

or, alternatively,

#![feature(diagnostic_namespace)]
#![deny(unknown_or_malformed_diagnostic_attributes)]

@GrigorenkoPV
Copy link
Contributor

GrigorenkoPV commented Mar 13, 2024

searched nightlies: from nightly-2024-01-01 to nightly-2024-03-12
regressed nightly: nightly-2024-03-09
searched commit range: 9c3ad80...46b180e
regressed commit: 9823f17

bisected with cargo-bisect-rustc v0.6.8

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc -vv --preserve --start=2024-01-01 --end=2024-03-12 --access=github --regress ice 

Probably #119888, cc @weiznich

@Noratrieb Noratrieb added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-diagnostics Area: Messages for errors, warnings, and lints labels Mar 14, 2024
@weiznich
Copy link
Contributor

I filled #122482 to address this

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Mar 14, 2024
…rors

Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint

This was missed during stablisation of the `#[diagnostic]` attribute namespace.

Fixes rust-lang#122446
@bors bors closed this as completed in 2541111 Mar 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Mar 14, 2024
Rollup merge of rust-lang#122482 - weiznich:fix/122446, r=compiler-errors

Ungate the `UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES` lint

This was missed during stablisation of the `#[diagnostic]` attribute namespace.

Fixes rust-lang#122446
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants