Skip to content

ICE:invalid predicate filter for remap_gat_vars_and_recurse_into_nested_projections #141694

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

Open
sososopy opened this issue May 28, 2025 · 1 comment
Labels
A-GATs Area: Generic associated types (GATs) 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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@sososopy
Copy link

Based on the question, only one related question #133275 was found, but it seems to be somewhat different.

Code

#![feature(const_trait_impl)]
#[const_trait]
trait Trait1<'a, T: ?Sized>
where
    for<'b> <Self as Trait1<'b, T>>::N: Clone,
{
    type N: ?Sized;
    fn func(&self, x: &Self::N) {
        <Self::N>::clone(x);
    }
}

Meta

rustc --version --verbose:

rustc 1.89.0-nightly (45f256d9d 2025-05-27)
binary: rustc
commit-hash: 45f256d9d7cffb66185c0bf1b8a864cba79db90c
commit-date: 2025-05-27
host: x86_64-pc-windows-msvc
release: 1.89.0-nightly
LLVM version: 20.1.5

Error output

error[E0601]: `main` function not found in crate `test`
  --> .\test.rs:11:2
   |
11 | }
   |  ^ consider adding a `main` function to `.\test.rs`

error[E0015]: cannot call non-const method `<<Self as Trait1<'_, T>>::N as Clone>::clone` in constant functions
 --> .\test.rs:9:9
  |
9 |         <Self::N>::clone(x);
  |         ^^^^^^^^^^^^^^^^^^^
  |
  = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
Backtrace

thread 'rustc' panicked at compiler\rustc_hir_analysis\src\collect\item_bounds.rs:129:25:
internal error: entered unreachable code: invalid predicate filter for `remap_gat_vars_and_recurse_into_nested_projections`
stack backtrace:
   0:     0x7ffe10daa092 - std::backtrace_rs::backtrace::win64::trace
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\..\..\backtrace\src\backtrace\win64.rs:85
   1:     0x7ffe10daa092 - std::backtrace_rs::backtrace::trace_unsynchronized
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
   2:     0x7ffe10daa092 - std::sys::backtrace::_print_fmt
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\sys\backtrace.rs:66
   3:     0x7ffe10daa092 - std::sys::backtrace::impl$0::print::impl$0::fmt
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\sys\backtrace.rs:39
   4:     0x7ffe10dddcdb - core::fmt::rt::Argument::fmt
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\core\src\fmt\rt.rs:173
   5:     0x7ffe10dddcdb - core::fmt::write
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\core\src\fmt\mod.rs:1446
   6:     0x7ffe10d9fce7 - std::io::default_write_fmt
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\io\mod.rs:639
   7:     0x7ffe10d9fce7 - std::io::Write::write_fmt<std::sys::stdio::windows::Stderr>
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\io\mod.rs:1914
   8:     0x7ffe10da9ed5 - std::sys::backtrace::BacktraceLock::print
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\sys\backtrace.rs:42
   9:     0x7ffe10dafc6a - std::panicking::default_hook::closure$0
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\panicking.rs:300
  10:     0x7ffe10dafa00 - std::panicking::default_hook
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\panicking.rs:327
  11:     0x7ffe124e2759 - core[ac12185d53e22e8f]::slice::sort::unstable::heapsort::heapsort::<((rustc_lint_defs[193b32fd50306806]::Level, &str), usize), <((rustc_lint_defs[193b32fd50306806]::Level, &str), usize) as core[ac12185d53e22e8f]::cmp::PartialOrd>::lt>
  12:     0x7ffe10db08fe - std::panicking::rust_panic_with_hook
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\panicking.rs:841
  13:     0x7ffe10db0622 - std::panicking::begin_panic_handler::closure$0
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\panicking.rs:699
  14:     0x7ffe10daae5f - std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\sys\backtrace.rs:168
  15:     0x7ffe10db025e - std::panicking::begin_panic_handler
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\panicking.rs:697
  16:     0x7ffe13f7a181 - core::panicking::panic_fmt
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\core\src\panicking.rs:75
  17:     0x7ffe1060efe9 - <rustc_hir_analysis[cd991074a42e8cf5]::autoderef::Autoderef>::structurally_normalize_ty
  18:     0x7ffe11087406 - RINvCsgyuORg7H3No_11rustc_arena7outlineNCINvMs6_B2_NtB2_13DroplessArena15alloc_from_iterTNtNtNtCs55DwxXtzdwY_12rustc_middle2ty9predicate6ClauseNtNtCs8zVwBRWrGp6_10rustc_span13span_encoding4SpanEINtNtNtNtCseLVy3z0Lp5b_4core4iter8adapters5chain5ChainINtNtNtC
  19:     0x7ffe105ec0dd - <rustc_hir_analysis[cd991074a42e8cf5]::collect::generics_of::has_late_bound_regions::LateBoundRegionsDetector as rustc_hir[a4e326894d30e240]::intravisit::Visitor>::visit_poly_trait_ref
  20:     0x7ffe105ec95c - <rustc_hir_analysis[cd991074a42e8cf5]::collect::generics_of::has_late_bound_regions::LateBoundRegionsDetector as rustc_hir[a4e326894d30e240]::intravisit::Visitor>::visit_poly_trait_ref
  21:     0x7ffe12ae759b - <rustc_hir_analysis[cd991074a42e8cf5]::collect::item_bounds::AssocTyToOpaque as rustc_type_ir[f84f795d5caa6a3b]::fold::TypeFolder<rustc_middle[3b4c1402574a7aca]::ty::context::TyCtxt>>::fold_ty       
  22:     0x7ffe1092973d - <alloc[eace62e2d56f260]::sync::Arc<rustc_session[16fbb01393245908]::cstore::CrateSource>>::drop_slow
  23:     0x7ffe1090d57d - <alloc[eace62e2d56f260]::sync::Arc<rustc_session[16fbb01393245908]::cstore::CrateSource>>::drop_slow
  24:     0x7ffe11bb7e6e - RINvNtNtCsiGEjBpC2ZP2_18rustc_query_system5query8plumbing17try_execute_queryINtCsjjmM8TuMoF7_16rustc_query_impl13DynamicConfigINtNtB4_6caches10DefIdCacheINtNtNtCs55DwxXtzdwY_12rustc_middle5query5erase6ErasedAhj10_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  25:     0x7ffe10936987 - rustc_query_impl[e0f175676c7ebdd7]::query_system
  26:     0x7ffe10a1c761 - rustc_trait_selection[5fe835ba5507d126]::traits::effects::evaluate_host_effect_obligation
  27:     0x7ffe11e1d291 - <rustc_trait_selection[5fe835ba5507d126]::traits::fulfill::FulfillProcessor as rustc_data_structures[9c22797fda12ffda]::obligation_forest::ObligationProcessor>::process_obligation
  28:     0x7ffe11d68f1e - <rustc_data_structures[9c22797fda12ffda]::obligation_forest::ObligationForest<rustc_trait_selection[5fe835ba5507d126]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[5fe835ba5507d126]::traits::fulfill::FulfillProcessor>
  29:     0x7ffe11daa18a - <rustc_data_structures[9c22797fda12ffda]::obligation_forest::ObligationForest<rustc_trait_selection[5fe835ba5507d126]::traits::fulfill::PendingPredicateObligation>>::uninlined_mark_dependents_as_waiting
  30:     0x7ffe1177b817 - <rustc_const_eval[4510b251ae541fec]::check_consts::qualifs::NeedsNonConstDrop as rustc_const_eval[4510b251ae541fec]::check_consts::qualifs::Qualif>::in_any_value_of_ty
  31:     0x7ffe116664c5 - <alloc[eace62e2d56f260]::raw_vec::RawVec<rustc_const_eval[4510b251ae541fec]::interpret::stack::Frame>>::grow_one
  32:     0x7ffe106f2906 - <rustc_const_eval[4510b251ae541fec]::check_consts::check::Checker>::check_drop_terminator
  33:     0x7ffe117783a5 - <rustc_const_eval[4510b251ae541fec]::check_consts::check::Checker as rustc_middle[3b4c1402574a7aca]::mir::visit::Visitor>::visit_terminator
  34:     0x7ffe11669f7f - <rustc_const_eval[4510b251ae541fec]::check_consts::check::Checker>::check_body
  35:     0x7ffe11245d1d - rustc_mir_transform[49de2cdd68dbf4ee]::mir_const_qualif
  36:     0x7ffe11d10230 - rustc_query_impl[e0f175676c7ebdd7]::plumbing::query_key_hash_verify_all
  37:     0x7ffe11bde61b - RINvNtNtCsiGEjBpC2ZP2_18rustc_query_system5query8plumbing17try_execute_queryINtCsjjmM8TuMoF7_16rustc_query_impl13DynamicConfigINtNtB4_6caches10DefIdCacheINtNtNtCs55DwxXtzdwY_12rustc_middle5query5erase6ErasedAhj4_EEKb0_KB3r_KB3r_ENtNtB1f_8plumbing9QueryCtxt
  38:     0x7ffe11d15981 - rustc_query_impl[e0f175676c7ebdd7]::plumbing::query_key_hash_verify_all
  39:     0x7ffe11249171 - rustc_mir_transform[49de2cdd68dbf4ee]::mir_promoted
  40:     0x7ffe11d0f849 - rustc_query_impl[e0f175676c7ebdd7]::plumbing::query_key_hash_verify_all
  41:     0x7ffe11c417f1 - RINvNtNtCsiGEjBpC2ZP2_18rustc_query_system5query8plumbing17try_execute_queryINtCsjjmM8TuMoF7_16rustc_query_impl13DynamicConfigINtNtCsdp6gSCMhqdi_21rustc_data_structures9vec_cache8VecCacheNtNtCs8zVwBRWrGp6_10rustc_span6def_id10LocalDefIdINtNtNtCs55DwxXtzdwY
  42:     0x7ffe11d16012 - rustc_query_impl[e0f175676c7ebdd7]::plumbing::query_key_hash_verify_all
  43:     0x7ffe114f8708 - rustc_borrowck[5c351b2b6f9e4865]::mir_borrowck
  44:     0x7ffe11d0f7cb - rustc_query_impl[e0f175676c7ebdd7]::plumbing::query_key_hash_verify_all
  45:     0x7ffe11c4a4b4 - RINvNtNtCsiGEjBpC2ZP2_18rustc_query_system5query8plumbing17try_execute_queryINtCsjjmM8TuMoF7_16rustc_query_impl13DynamicConfigINtNtCsdp6gSCMhqdi_21rustc_data_structures9vec_cache8VecCacheNtNtCs8zVwBRWrGp6_10rustc_span6def_id10LocalDefIdINtNtNtCs55DwxXtzdwY
  46:     0x7ffe11d1a072 - rustc_query_impl[e0f175676c7ebdd7]::plumbing::query_key_hash_verify_all
  47:     0x7ffe10e1c994 - <rustc_interface[6bd24b2f061a6461]::passes::LintStoreExpandImpl as rustc_expand[ee8b454fe707dc9e]::base::LintStoreExpand>::pre_expansion_lint
  48:     0x7ffe0d39a507 - rustc_interface[6bd24b2f061a6461]::passes::analysis
  49:     0x7ffe10929d8a - <alloc[eace62e2d56f260]::sync::Arc<rustc_session[16fbb01393245908]::cstore::CrateSource>>::drop_slow
  50:     0x7ffe108311ea - RINvNtNtCsiGEjBpC2ZP2_18rustc_query_system5query8plumbing17try_execute_queryINtCsjjmM8TuMoF7_16rustc_query_impl13DynamicConfigINtNtB4_6caches11SingleCacheINtNtNtCs55DwxXtzdwY_12rustc_middle5query5erase6ErasedAhj0_EEKb0_KB3s_KB3s_ENtNtB1f_8plumbing9QueryCtx
  51:     0x7ffe10930413 - rustc_query_impl[e0f175676c7ebdd7]::query_system
  52:     0x7ffe0d35eef5 - std[447c3cd9e98ab315]::sys::backtrace::__rust_begin_short_backtrace::<<std[447c3cd9e98ab315]::thread::Builder>::spawn_unchecked_<ctrlc[d724601dd3fb70d4]::set_handler_inner<rustc_driver_impl[e5fceb87a81e35f5]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  53:     0x7ffe0d359165 - std[447c3cd9e98ab315]::sys::backtrace::__rust_begin_short_backtrace::<<std[447c3cd9e98ab315]::thread::Builder>::spawn_unchecked_<ctrlc[d724601dd3fb70d4]::set_handler_inner<rustc_driver_impl[e5fceb87a81e35f5]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  54:     0x7ffe0d35438f - RINvNtNtCs5SxPwUNJkn9_3std3sys9backtrace28___rust_begin_short_backtraceNCNCINvNtCs9fVJ9cGiVK7_15rustc_interface4util26run_in_thread_with_globalsNCINvB1e_31run_in_thread_pool_with_globalsNCINvNtB1g_9interface12run_compileruNCNvCsjKdFQ38TYNZ_17rustc_driver_i
  55:     0x7ffe0d36325d - std[447c3cd9e98ab315]::sys::backtrace::__rust_begin_short_backtrace::<<std[447c3cd9e98ab315]::thread::Builder>::spawn_unchecked_<ctrlc[d724601dd3fb70d4]::set_handler_inner<rustc_driver_impl[e5fceb87a81e35f5]::install_ctrlc_handler::{closure#0}>::{closure#0}, ()>::{closure#1}::{closure#0}::{closure#0}, ()>
  56:     0x7ffe10db4c6d - alloc::boxed::impl$28::call_once
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\alloc\src\boxed.rs:1966
  57:     0x7ffe10db4c6d - alloc::boxed::impl$28::call_once
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\alloc\src\boxed.rs:1966
  58:     0x7ffe10db4c6d - std::sys::pal::windows::thread::impl$0::new::thread_start
                               at /rustc/45f256d9d7cffb66185c0bf1b8a864cba79db90c/library\std\src\sys\pal\windows\thread.rs:56
  59:     0x7ffee8147374 - BaseThreadInitThunk
  60:     0x7ffeea0bcc91 - RtlUserThreadStart

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 `D:\rust_test\gpt_generate_mutators\rustc-ice-2025-05-28T14_03_30-18580.txt` to your bug report

query stack during panic:
#0 [explicit_implied_const_bounds] computing the implied `~const` bounds for `Trait1::N`
#1 [mir_const_qualif] const checking `Trait1::func`
... and 3 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
error: aborting due to 2 previous errors

@sososopy sososopy added 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. C-bug Category: This is a bug. labels May 28, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 28, 2025
@cyrgani
Copy link
Contributor

cyrgani commented May 28, 2025

#![feature(const_trait_impl)]
trait Clon {
    fn clon() -> Self;
}
#[const_trait]
trait Trait1
where
    <Self as Trait1>::N: Clon,
{
    type N;
    fn func() {
        <Self::N>::clon();
    }
}

@Noratrieb Noratrieb added T-types Relevant to the types team, which will review and decide on the PR/issue. A-GATs Area: Generic associated types (GATs) and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-GATs Area: Generic associated types (GATs) 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. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants