Skip to content

ICE ForceWarning != Error | Warning | Allow | Expect #142144

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

rustc a.rs --force-warn pub_use_of_private_extern_crate

extern crate core;
pub use core as reexported_core;

fn main() {}

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (44f415c1d 2025-06-06)
binary: rustc
commit-hash: 44f415c1d617ebc7b931a243b7b321ef8a6ca47c
commit-date: 2025-06-06
host: x86_64-unknown-linux-gnu
release: 1.89.0-nightly
LLVM version: 20.1.5

Error output

<output>
Backtrace

thread 'rustc' panicked at compiler/rustc_errors/src/lib.rs:1532:13:
assertion `left matches right` failed
  left: ForceWarning
 right: Error | Warning | Allow | Expect
stack backtrace:
   0:     0x7a427a70d493 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::ha891fbe7876a9c28
   1:     0x7a427ae02cf7 - core::fmt::write::hb5ee2653f290f031
   2:     0x7a427a7030f3 - std::io::Write::write_fmt::h672a3de6ab1cdb45
   3:     0x7a427a70d2f2 - std::sys::backtrace::BacktraceLock::print::h9fd0bbed52d45e92
   4:     0x7a427a710eea - std::panicking::default_hook::{{closure}}::h8a1e8d4cf47a692c
   5:     0x7a427a710a6f - std::panicking::default_hook::hf31cfaaca3a607a2
   6:     0x7a42798169b3 - std[bcad9b04b3b952e4]::panicking::update_hook::<alloc[f0dc799087a75c16]::boxed::Box<rustc_driver_impl[2ceea16ddf85e8fa]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7a427a711763 - std::panicking::rust_panic_with_hook::hc041d3eaddc8a252
   8:     0x7a427a71145a - std::panicking::begin_panic_handler::{{closure}}::h1789b60696483c65
   9:     0x7a427a70d959 - std::sys::backtrace::__rust_end_short_backtrace::h65c778548f450cf2
  10:     0x7a427a71111d - __rustc[8b86f73cc16cac0]::rust_begin_unwind
  11:     0x7a4276e796c0 - core::panicking::panic_fmt::h3a9b0eb4e514e696
  12:     0x7a427921cb3a - core::panicking::assert_failed_inner::hf28f417ea60d2519
  13:     0x7a4279847cb1 - core[1684b382b3cb289c]::panicking::assert_matches_failed::<rustc_errors[83246f4268492b91]::Level>
  14:     0x7a427c385d6e - <rustc_errors[83246f4268492b91]::DiagCtxtInner>::emit_diagnostic
  15:     0x7a427c385239 - <rustc_errors[83246f4268492b91]::DiagCtxtHandle>::emit_diagnostic
  16:     0x7a427c3850d5 - <() as rustc_errors[83246f4268492b91]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  17:     0x7a427b6b9645 - rustc_middle[73808c43a936ddaa]::lint::lint_level::lint_level_impl
  18:     0x7a427af32325 - <rustc_lint[3921f83589c15283]::early::EarlyContextAndPass<rustc_lint[3921f83589c15283]::BuiltinCombinedEarlyLintPass> as rustc_ast[97ec933858ce6ae7]::visit::Visitor>::visit_item
  19:     0x7a427bea6761 - rustc_interface[ab47e915ec4db7a9]::passes::early_lint_checks
  20:     0x7a427bea600d - rustc_query_impl[8584cea66e475d6d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8584cea66e475d6d]::query_impl::early_lint_checks::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>
  21:     0x7a427bf2640e - rustc_query_system[5c2810be960c7739]::query::plumbing::try_execute_query::<rustc_query_impl[8584cea66e475d6d]::DynamicConfig<rustc_query_system[5c2810be960c7739]::query::caches::SingleCache<rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8584cea66e475d6d]::plumbing::QueryCtxt, false>
  22:     0x7a427bf2620e - rustc_query_impl[8584cea66e475d6d]::query_impl::early_lint_checks::get_query_non_incr::__rust_end_short_backtrace
  23:     0x7a427bb57beb - rustc_ast_lowering[5880676878ca1506]::lower_to_hir
  24:     0x7a427bf25aba - rustc_query_impl[8584cea66e475d6d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8584cea66e475d6d]::query_impl::hir_crate::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 8usize]>>
  25:     0x7a427bf28681 - rustc_query_system[5c2810be960c7739]::query::plumbing::try_execute_query::<rustc_query_impl[8584cea66e475d6d]::DynamicConfig<rustc_query_system[5c2810be960c7739]::query::caches::SingleCache<rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[8584cea66e475d6d]::plumbing::QueryCtxt, false>
  26:     0x7a427bf27e80 - rustc_query_impl[8584cea66e475d6d]::query_impl::hir_crate::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7a427b14db66 - rustc_interface[ab47e915ec4db7a9]::passes::analysis
  28:     0x7a427b14daf5 - rustc_query_impl[8584cea66e475d6d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[8584cea66e475d6d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>
  29:     0x7a427bf2640e - rustc_query_system[5c2810be960c7739]::query::plumbing::try_execute_query::<rustc_query_impl[8584cea66e475d6d]::DynamicConfig<rustc_query_system[5c2810be960c7739]::query::caches::SingleCache<rustc_middle[73808c43a936ddaa]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[8584cea66e475d6d]::plumbing::QueryCtxt, false>
  30:     0x7a427bf25ff6 - rustc_query_impl[8584cea66e475d6d]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  31:     0x7a427c155b3f - rustc_interface[ab47e915ec4db7a9]::passes::create_and_enter_global_ctxt::<core[1684b382b3cb289c]::option::Option<rustc_interface[ab47e915ec4db7a9]::queries::Linker>, rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  32:     0x7a427c145e30 - rustc_interface[ab47e915ec4db7a9]::interface::run_compiler::<(), rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}>::{closure#1}
  33:     0x7a427bee25be - std[bcad9b04b3b952e4]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_with_globals<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_pool_with_globals<rustc_interface[ab47e915ec4db7a9]::interface::run_compiler<(), rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  34:     0x7a427bee2296 - <<std[bcad9b04b3b952e4]::thread::Builder>::spawn_unchecked_<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_with_globals<rustc_interface[ab47e915ec4db7a9]::util::run_in_thread_pool_with_globals<rustc_interface[ab47e915ec4db7a9]::interface::run_compiler<(), rustc_driver_impl[2ceea16ddf85e8fa]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[1684b382b3cb289c]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  35:     0x7a427c09abfd - std::sys::pal::unix::thread::Thread::new::thread_start::h0cca23f6750922f6
  36:     0x7a4275aa57eb - <unknown>
  37:     0x7a4275b2918c - <unknown>
  38:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: please attach the file at `/tmp/im/rustc-ice-2025-06-07T06_51_22-2442283.txt` to your bug report

query stack during panic:
#0 [early_lint_checks] perform lints prior to AST lowering
#1 [hir_crate] getting the crate HIR
#2 [analysis] running analysis passes on this crate
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions