Skip to content

ICE error: Assertion failed in compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs:385:17 #146392

Closed as duplicate

Description

@brutalsavage

Code

fn main() {
    let _: &mut (dyn ?Sized + !Send) = &mut {};
}

Meta

rustc --version --verbose:

rustc 1.91.0-nightly (9c27f27ea 2025-09-08)
binary: rustc
commit-hash: 9c27f27ea3bab79a2fec827ef3ae0009959d60f4
commit-date: 2025-09-08
host: x86_64-unknown-linux-gnu
release: 1.91.0-nightly
LLVM version: 21.1.0

Error output

error: negative bounds are not supported
 --> test.fuzz:2:31
  |
2 |     let _: &mut (dyn ?Sized + !Send) = &mut {};
  |                               ^

error: relaxed bounds are not permitted in trait object types
 --> test.fuzz:2:22
  |
2 |     let _: &mut (dyn ?Sized + !Send) = &mut {};
  |                      ^^^^^^


thread 'rustc' (388594) panicked at compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs:385:17:
assertion `left == right` failed
  left: Negative
 right: Positive
Backtrace

stack backtrace:
   0:     0x7f04913afec3 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hf30880b118ce69a7
   1:     0x7f0491a01bd8 - core::fmt::write::h2adee94c9530c769
   2:     0x7f0491364cf1 - std::io::Write::write_fmt::hf9fd682cd305994d
   3:     0x7f0491375e12 - std::sys::backtrace::BacktraceLock::print::h2e8eaa47e6244167
   4:     0x7f049137bd59 - std::panicking::default_hook::{{closure}}::hce66ca19674736b6
   5:     0x7f049137b883 - std::panicking::default_hook::h378eb22e7f245ba6
   6:     0x7f04903c3707 - std[60f4c921464387a8]::panicking::update_hook::<alloc[af66c0f7f367d3a4]::boxed::Box<rustc_driver_impl[6e5208ea2b150886]::install_ice_hook::{closure#1}>>::{closure#0}
   7:     0x7f049137c17f - std::panicking::panic_with_hook::h107561c887d41fb4
   8:     0x7f049137bf3a - std::panicking::panic_handler::{{closure}}::h22ca1e42f3e34cf3
   9:     0x7f0491375f49 - std::sys::backtrace::__rust_end_short_backtrace::h2a269d3827952e51
  10:     0x7f049135672d - __rustc[46dfa2e28c3cccbc]::rust_begin_unwind
  11:     0x7f048dabf8f0 - core::panicking::panic_fmt::hb26515e908d4a63d
  12:     0x7f048fdbbb03 - core::panicking::assert_failed_inner::h54b5c33d4b117389
  13:     0x7f04910fa013 - core[494a681d6e07a62e]::panicking::assert_failed::<rustc_type_ir[539e53880383513c]::predicate::PredicatePolarity, rustc_type_ir[539e53880383513c]::predicate::PredicatePolarity>
  14:     0x7f0492877393 - <dyn rustc_hir_analysis[84a042027edab4a]::hir_ty_lowering::HirTyLowerer>::lower_trait_object_ty::{closure#0}
  15:     0x7f049243b967 - <dyn rustc_hir_analysis[84a042027edab4a]::hir_ty_lowering::HirTyLowerer>::lower_ty::{closure#0}
  16:     0x7f049243acca - <dyn rustc_hir_analysis[84a042027edab4a]::hir_ty_lowering::HirTyLowerer>::lower_ty::{closure#0}
  17:     0x7f0492008fde - <rustc_hir_typeck[4caaa11dff9d1644]::gather_locals::GatherLocalsVisitor>::declare
  18:     0x7f0492005128 - <rustc_hir_typeck[4caaa11dff9d1644]::fn_ctxt::FnCtxt>::check_expr_block
  19:     0x7f04920878fb - <rustc_hir_typeck[4caaa11dff9d1644]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  20:     0x7f0492010718 - rustc_hir_typeck[4caaa11dff9d1644]::check::check_fn
  21:     0x7f0491f14044 - rustc_hir_typeck[4caaa11dff9d1644]::typeck_with_inspect::{closure#0}
  22:     0x7f0491f12836 - rustc_query_impl[d503ea7333d9f192]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d503ea7333d9f192]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[62f76fb1ad15f043]::query::erase::Erased<[u8; 8usize]>>
  23:     0x7f0491c2f345 - rustc_query_system[36926af04fc30fbf]::query::plumbing::try_execute_query::<rustc_query_impl[d503ea7333d9f192]::DynamicConfig<rustc_data_structures[d45417cb7c5e80c2]::vec_cache::VecCache<rustc_span[84d5e499882068e4]::def_id::LocalDefId, rustc_middle[62f76fb1ad15f043]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[36926af04fc30fbf]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[d503ea7333d9f192]::plumbing::QueryCtxt, false>
  24:     0x7f0491c2ed89 - rustc_query_impl[d503ea7333d9f192]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  25:     0x7f0491c3aab1 - rustc_hir_analysis[84a042027edab4a]::check_crate
  26:     0x7f0491c272f0 - rustc_interface[f234d5aad18497a0]::passes::analysis
  27:     0x7f0491c26fa1 - rustc_query_impl[d503ea7333d9f192]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[d503ea7333d9f192]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[62f76fb1ad15f043]::query::erase::Erased<[u8; 0usize]>>
  28:     0x7f0492a0f526 - rustc_query_system[36926af04fc30fbf]::query::plumbing::try_execute_query::<rustc_query_impl[d503ea7333d9f192]::DynamicConfig<rustc_query_system[36926af04fc30fbf]::query::caches::SingleCache<rustc_middle[62f76fb1ad15f043]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[d503ea7333d9f192]::plumbing::QueryCtxt, false>
  29:     0x7f0492a0f17c - rustc_query_impl[d503ea7333d9f192]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  30:     0x7f0492cd35a4 - rustc_interface[f234d5aad18497a0]::passes::create_and_enter_global_ctxt::<core[494a681d6e07a62e]::option::Option<rustc_interface[f234d5aad18497a0]::queries::Linker>, rustc_driver_impl[6e5208ea2b150886]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  31:     0x7f0492c734be - rustc_interface[f234d5aad18497a0]::interface::run_compiler::<(), rustc_driver_impl[6e5208ea2b150886]::run_compiler::{closure#0}>::{closure#1}
  32:     0x7f0492bb3c78 - std[60f4c921464387a8]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[f234d5aad18497a0]::util::run_in_thread_with_globals<rustc_interface[f234d5aad18497a0]::util::run_in_thread_pool_with_globals<rustc_interface[f234d5aad18497a0]::interface::run_compiler<(), rustc_driver_impl[6e5208ea2b150886]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  33:     0x7f0492bb395c - <<std[60f4c921464387a8]::thread::Builder>::spawn_unchecked_<rustc_interface[f234d5aad18497a0]::util::run_in_thread_with_globals<rustc_interface[f234d5aad18497a0]::util::run_in_thread_pool_with_globals<rustc_interface[f234d5aad18497a0]::interface::run_compiler<(), rustc_driver_impl[6e5208ea2b150886]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[494a681d6e07a62e]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  34:     0x7f0492bb9e8d - std::sys::pal::unix::thread::Thread::new::thread_start::h0ed16f40fa4b751a
  35:     0x7f048c66bac3 - start_thread
                               at ./nptl/pthread_create.c:442:8
  36:     0x7f048c6fd850 - __GI___clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81:0
  37:                0x0 - <unknown>

Activity

  1. added
    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.
    C-bugCategory: This is a bug.
    on Sep 9, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 9, 2025
  3. fmease commented on Sep 9, 2025

    @fmease
    Member

    Thanks for your report! Please try to look for duplicates first. Dupe of #144241.

  4. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Sep 9, 2025
  5. brutalsavage commented on Sep 9, 2025

    @brutalsavage
    Author

    Thanks for the check, sorry I had previously seen the issue you pointed out but saw the error line was slightly different in this one, will check more carefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    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