Skip to content

ICE inferred lifetime in signature #148949

Open

Description

@matthiaskrgr

snippet:

#![feature(min_generic_const_args)]
#![feature(inherent_associated_types)]
struct Foo<'a> {
    x: &'a (),
}

impl<'a> Foo<'a> {
    fn foo(_: [u8; Foo::X]) {}
}

fn main() {}

Version information

rustc 1.93.0-nightly (c91009892 2025-11-14)
binary: rustc
commit-hash: c91009892b4cd1776d4c9d85793166612195a03d
commit-date: 2025-11-14
host: x86_64-unknown-linux-gnu
release: 1.93.0-nightly
LLVM version: 21.1.5

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.C4RdvOM2TnqW/rustc_testrunner_tmpdir_reporting.FKNzgy6tMw5C/mvce.rs:1:12
  |
1 | #![feature(min_generic_const_args)]
  |            ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
  = note: `#[warn(incomplete_features)]` on by default

warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /tmp/icemaker_global_tempdir.C4RdvOM2TnqW/rustc_testrunner_tmpdir_reporting.FKNzgy6tMw5C/mvce.rs:2:12
  |
2 | #![feature(inherent_associated_types)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information

warning: struct `Foo` is never constructed
 --> /tmp/icemaker_global_tempdir.C4RdvOM2TnqW/rustc_testrunner_tmpdir_reporting.FKNzgy6tMw5C/mvce.rs:3:8
  |
3 | struct Foo<'a> {
  |        ^^^
  |
  = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: associated function `foo` is never used
 --> /tmp/icemaker_global_tempdir.C4RdvOM2TnqW/rustc_testrunner_tmpdir_reporting.FKNzgy6tMw5C/mvce.rs:8:8
  |
7 | impl<'a> Foo<'a> {
  | ---------------- associated function in this implementation
8 |     fn foo(_: [u8; Foo::X]) {}
  |        ^^^

warning: 4 warnings emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: unelided lifetime in signature
 --> /tmp/icemaker_global_tempdir.C4RdvOM2TnqW/rustc_testrunner_tmpdir_reporting.FKNzgy6tMw5C/mvce.rs:8:20
  |
8 |     fn foo(_: [u8; Foo::X]) {}
  |                    ^^^
  |
note: delayed at compiler/rustc_hir_analysis/src/collect.rs:334:13
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
         3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, &str>
         4: <rustc_hir_analysis::collect::ItemCtxt as rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::re_infer
         5: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_resolved_ty_path
         6: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty::{closure#0}
         7: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
         8: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty::{closure#0}
         9: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_fn_ty
        10: rustc_hir_analysis::collect::lower_fn_sig_recovering_infer_ret_ty
        11: rustc_hir_analysis::collect::fn_sig
        12: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::fn_sig::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
        13: <rustc_query_impl::query_impl::fn_sig::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        15: rustc_query_impl::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
        16: <rustc_hir_analysis::variance::constraints::ConstraintContext>::build_constraints_for_item
        17: rustc_hir_analysis::variance::crate_variances
        18: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::crate_variances::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
        19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        20: rustc_query_impl::query_impl::crate_variances::get_query_non_incr::__rust_end_short_backtrace
        21: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::variances_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>.warm
        22: <rustc_query_impl::query_impl::variances_of::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        24: rustc_query_impl::query_impl::variances_of::get_query_non_incr::__rust_end_short_backtrace
        25: rustc_hir_analysis::check::wfcheck::check_variances_for_type_defn
        26: rustc_hir_analysis::check::check::check_item_type
        27: rustc_hir_analysis::check::wfcheck::check_well_formed
        28: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        29: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 1]>, rustc_query_system::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        30: rustc_query_impl::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
        31: rustc_hir_analysis::check::wfcheck::check_type_wf
        32: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        33: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        34: rustc_query_impl::query_impl::check_type_wf::get_query_non_incr::__rust_end_short_backtrace
        35: rustc_hir_analysis::check_crate
        36: rustc_interface::passes::analysis
        37: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
        38: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        39: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        40: <rustc_interface::passes::create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2} as core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy>, &std::sync::once_lock::OnceLock<rustc_middle::ty::context::GlobalCtxt>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_middle::arena::Arena>, &rustc_data_structures::sync::worker_local::WorkerLocal<rustc_hir::Arena>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2})>>::call_once::{shim:vtable#0}
        41: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
        42: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
        43: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
        44: std::sys::thread::unix::Thread::new::thread_start
        45: <unknown>
        46: <unknown>
      
 --> /tmp/icemaker_global_tempdir.C4RdvOM2TnqW/rustc_testrunner_tmpdir_reporting.FKNzgy6tMw5C/mvce.rs:8:20
  |
8 |     fn foo(_: [u8; Foo::X]) {}
  |                    ^^^

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: rustc 1.93.0-nightly (c91009892 2025-11-14) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

@rustbot label +F-min_generic_const_args +F-inherent_associated_types

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 Nov 14, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    F-gca_min_const_items`#![feature(gca_min_const_items)]` (previously: `min_generic_const_args`)
    on Nov 14, 2025
  3. matthiaskrgr commented on Nov 14, 2025

    @matthiaskrgr
    MemberAuthor

    since #148771

  4. moved this to Dont' Worry (mGCA) in Inherent Associated Types (IAT)on Nov 14, 2025
  5. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 14, 2025
  6. charmitro commented on Nov 24, 2025

    @charmitro
    Contributor

    I believe this is happening because PR #148771's early bailout doesn't account for error-containing self types (like Foo without a lifetime), causing the delayed bug from lifetime inference failure to surface as an ICE.

  7. reddevilmidzy commented on Dec 9, 2025

    @reddevilmidzy
    Member

    @rustbot claim

  8. reddevilmidzy commented on Dec 9, 2025

    @reddevilmidzy
    Member
    #![allow(incomplete_features, unused)]
    #![feature(min_generic_const_args)]
    #![feature(inherent_associated_types)]
    struct Foo<'a> {
        x: &'a (),
    }
    
    impl<'a> Foo<'a> {
        #[type_const]
        const X: usize = 1;
        fn foo(_: [u8; Foo::X]) {}
    }
    
    fn main() {}

    This code also causes the same ICE, but it occurs before the PR mentioned.

    Program output
    --- stderr -------------------------------
    error: internal compiler error: compiler\rustc_middle\src\ty\context.rs:2979:17: args not compatible with generics for Foo::<'a>::Y: args=[
                                        Foo<'{region error}>,
                                    ], generics=[
                                        'a/#0,
                                    ]
    
    
    thread 'rustc' (14264) panicked at compiler\rustc_middle\src\ty\context.rs:2979:17:
    Box<dyn Any>
    stack backtrace:
       0: std::panicking::begin_panic<rustc_errors::ExplicitBug>
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panicking.rs:770
       1: std::panic::panic_any<rustc_errors::ExplicitBug>
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panic.rs:260
       2: rustc_errors::diagnostic::impl$2::emit_producing_guarantee
                 at .\compiler\rustc_errors\src\diagnostic.rs:63
       3: rustc_errors::diagnostic::Diag::emit<rustc_errors::diagnostic::BugAbort>
                 at .\compiler\rustc_errors\src\diagnostic.rs:1405
       4: rustc_errors::DiagCtxtHandle::bug<alloc::string::String>
                 at .\compiler\rustc_errors\src\lib.rs:1230
       5: rustc_middle::util::bug::opt_span_bug_fmt::closure$0<rustc_span::span_encoding::Span>
                 at .\compiler\rustc_middle\src\util\bug.rs:39
       6: rustc_middle::ty::context::tls::with_opt::closure$0<rustc_middle::util::bug::opt_span_bug_fmt::closure_env$0<rustc_span::span_encoding::Span>,never$>
                 at .\compiler\rustc_middle\src\ty\context\tls.rs:136
       7: rustc_middle::ty::context::tls::with_context_opt<rustc_middle::ty::context::tls::with_opt::closure_env$0<rustc_middle::util::bug::opt_span_bug_fmt::closure_env$0<rustc_span::span_encoding::Span>,never$>,never$>
                 at .\compiler\rustc_middle\src\ty\context\tls.rs:79
       8: rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt::closure_env$0<rustc_span::span_encoding::Span>,never$>
                 at .\compiler\rustc_middle\src\ty\context\tls.rs:134
       9: rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>
                 at .\compiler\rustc_middle\src\util\bug.rs:33
      10: rustc_middle::util::bug::bug_fmt
                 at .\compiler\rustc_middle\src\util\bug.rs:16
      11: rustc_middle::ty::context::TyCtxt::debug_assert_args_compatible
                 at .\compiler\rustc_middle\src\macros.rs:18
      12: rustc_middle::ty::consts::Const::new_unevaluated
                 at .\compiler\rustc_middle\src\ty\consts.rs:116
      13: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_type_relative_const_path::closure$0
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:1303
      14: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_type_relative_const_path
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:1268
      15: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_const_arg
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:2257
      16: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_ty::closure$0
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:2582
      17: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_ty
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:2451
      18: rustc_hir_analysis::collect::impl$2::lower_fn_sig::closure$0
                 at .\compiler\rustc_hir_analysis\src\collect.rs:542
      19: core::iter::adapters::map::map_fold::closure$0
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\adapters\map.rs:88
      20: core::iter::adapters::enumerate::impl$1::fold::enumerate::closure$0
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\adapters\enumerate.rs:140
      21: core::slice::iter::impl$166::fold
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\slice\iter\macros.rs:255
      22: core::iter::adapters::enumerate::impl$1::fold
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\adapters\enumerate.rs:146
      23: core::iter::adapters::map::impl$2::fold<rustc_middle::ty::Ty,core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Ty<tuple$<> > > >,rustc_hir_analysis::collect::impl$2::lower_fn_sig::closure_env$0,tuple$<>,core::iter::traits::
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\adapters\map.rs:128
      24: core::iter::traits::iterator::Iterator::for_each
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\traits\iterator.rs:828
      25: alloc::vec::Vec::extend_trusted
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\alloc\src\vec\mod.rs:3825
      26: alloc::vec::spec_extend::impl$1::spec_extend
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\alloc\src\vec\spec_extend.rs:26
      27: alloc::vec::spec_from_iter_nested::impl$1::from_iter
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\alloc\src\vec\spec_from_iter_nested.rs:60
      28: alloc::vec::spec_from_iter::impl$0::from_iter<rustc_middle::ty::Ty,core::iter::adapters::map::Map<core::iter::adapters::enumerate::Enumerate<core::slice::iter::Iter<rustc_hir::hir::Ty<tuple$<> > > >,rustc_hir_analysis::collect::impl$2::lower_fn_sig::closur
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\alloc\src\vec\spec_from_iter.rs:33
      29: alloc::vec::impl$15::from_iter
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\alloc\src\vec\mod.rs:3689
      30: core::iter::traits::iterator::Iterator::collect
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\traits\iterator.rs:2028
      31: rustc_hir_analysis::collect::impl$2::lower_fn_sig
                 at .\compiler\rustc_hir_analysis\src\collect.rs:544
      32: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_fn_ty::closure$0
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:2708
      33: rustc_hir_analysis::hir_ty_lowering::impl$2::lower_fn_ty
                 at .\compiler\rustc_hir_analysis\src\hir_ty_lowering\mod.rs:2694
      34: rustc_hir_analysis::collect::lower_fn_sig_recovering_infer_ret_ty
                 at .\compiler\rustc_hir_analysis\src\collect.rs:1118
      35: rustc_hir_analysis::collect::fn_sig::closure$0
                 at .\compiler\rustc_hir_analysis\src\collect.rs:1052
      36: rustc_hir_analysis::collect::fn_sig
                 at .\compiler\rustc_hir_analysis\src\collect.rs:1019
      37: rustc_query_impl::query_impl::fn_sig::dynamic_query::closure$2::closure$0
                 at .\compiler\rustc_query_impl\src\plumbing.rs:302
          [... omitted 18 frames ...]
      38: rustc_middle::query::inner::query_get_at
                 at .\compiler\rustc_middle\src\query\inner.rs:33
      39: rustc_middle::query::plumbing::TyCtxtAt::fn_sig
                 at .\compiler\rustc_middle\src\query\plumbing.rs:415
      40: rustc_middle::ty::context::TyCtxt::fn_sig
                 at .\compiler\rustc_middle\src\query\plumbing.rs:406
      41: rustc_hir_analysis::variance::constraints::ConstraintContext::build_constraints_for_item
                 at .\compiler\rustc_hir_analysis\src\variance\constraints.rs:139
      42: rustc_hir_analysis::variance::constraints::add_constraints_from_crate
                 at .\compiler\rustc_hir_analysis\src\variance\constraints.rs:81
      43: rustc_hir_analysis::variance::crate_variances
                 at .\compiler\rustc_hir_analysis\src\variance\mod.rs:32
      44: rustc_query_impl::query_impl::crate_variances::dynamic_query::closure$2::closure$0
                 at .\compiler\rustc_query_impl\src\plumbing.rs:298
          [... omitted 18 frames ...]
      45: rustc_hir_analysis::variance::variances_of
                 at .\compiler\rustc_hir_analysis\src\variance\mod.rs:0
      46: rustc_query_impl::query_impl::variances_of::dynamic_query::closure$2::closure$0
                 at .\compiler\rustc_query_impl\src\plumbing.rs:302
          [... omitted 18 frames ...]
      47: rustc_middle::query::inner::query_get_at
                 at .\compiler\rustc_middle\src\query\inner.rs:33
      48: rustc_middle::query::plumbing::TyCtxtAt::variances_of
                 at .\compiler\rustc_middle\src\query\plumbing.rs:415
      49: rustc_middle::ty::context::TyCtxt::variances_of
                 at .\compiler\rustc_middle\src\query\plumbing.rs:406
      50: rustc_hir_analysis::check::wfcheck::check_variances_for_type_defn
                 at .\compiler\rustc_hir_analysis\src\check\wfcheck.rs:1928
      51: rustc_hir_analysis::check::check::check_struct
                 at .\compiler\rustc_hir_analysis\src\check\check.rs:100
      52: rustc_hir_analysis::check::check::check_item_type
                 at .\compiler\rustc_hir_analysis\src\check\check.rs:867
      53: rustc_hir_analysis::check::wfcheck::check_well_formed
                 at .\compiler\rustc_hir_analysis\src\check\wfcheck.rs:196
      54: rustc_query_impl::query_impl::check_well_formed::dynamic_query::closure$2::closure$0
                 at .\compiler\rustc_query_impl\src\plumbing.rs:298
          [... omitted 18 frames ...]
      55: rustc_middle::query::inner::query_ensure_error_guaranteed<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId,rustc_middle::query::erase::Erased<array$<u8,1> >,rustc_query_system::dep_graph::graph::DepNodeIndex>,tuple$<> >
                 at .\compiler\rustc_middle\src\query\inner.rs:73
      56: rustc_middle::query::plumbing::TyCtxtEnsureOk::check_well_formed
                 at .\compiler\rustc_middle\src\query\plumbing.rs:176
      57: rustc_hir_analysis::check::wfcheck::check_type_wf::closure$0
                 at .\compiler\rustc_hir_analysis\src\check\wfcheck.rs:2261
      58: rustc_middle::hir::impl$0::par_items::closure$0
                 at .\compiler\rustc_middle\src\hir\mod.rs:106
      59: rustc_data_structures::sync::parallel::try_par_for_each_in::closure$0::closure$1::closure$0
                 at .\compiler\rustc_data_structures\src\sync\parallel.rs:212
      60: core::panic::unwind_safe::impl$25::call_once
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\panic\unwind_safe.rs:274
      61: std::panicking::catch_unwind::do_call
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panicking.rs:590
      62: std::panicking::catch_unwind
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panicking.rs:553
      63: std::panic::catch_unwind
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panic.rs:359
      64: rustc_data_structures::sync::parallel::ParallelGuard::run
                 at .\compiler\rustc_data_structures\src\sync\parallel.rs:23
      65: rustc_data_structures::sync::parallel::try_par_for_each_in::closure$0::closure$1
                 at .\compiler\rustc_data_structures\src\sync\parallel.rs:212
      66: core::iter::adapters::filter_map::filter_map_fold::closure$0
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\adapters\filter_map.rs:39
      67: core::slice::iter::impl$166::fold
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\slice\iter\macros.rs:255
      68: core::iter::adapters::filter_map::impl$2::fold
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\iter\adapters\filter_map.rs:146
      69: rustc_data_structures::sync::parallel::try_par_for_each_in::closure$0
                 at .\compiler\rustc_data_structures\src\sync\parallel.rs:212
      70: rustc_data_structures::sync::parallel::parallel_guard
                 at .\compiler\rustc_data_structures\src\sync\parallel.rs:39
      71: rustc_data_structures::sync::parallel::try_par_for_each_in<ref$<slice2$<rustc_hir::hir::ItemId> >,rustc_span::ErrorGuaranteed,rustc_middle::hir::impl$0::par_items::closure_env$0<rustc_hir_analysis::check::wfcheck::check_type_wf::closure_env$0> >
                 at .\compiler\rustc_data_structures\src\sync\parallel.rs:198
      72: rustc_middle::hir::ModuleItems::par_items<rustc_hir_analysis::check::wfcheck::check_type_wf::closure_env$0>
                 at .\compiler\rustc_middle\src\hir\mod.rs:106
      73: rustc_hir_analysis::check::wfcheck::check_type_wf
                 at .\compiler\rustc_hir_analysis\src\check\wfcheck.rs:2261
      74: rustc_query_impl::query_impl::check_type_wf::dynamic_query::closure$2::closure$0
                 at .\compiler\rustc_query_impl\src\plumbing.rs:298
          [... omitted 18 frames ...]
      75: rustc_middle::query::inner::query_ensure_error_guaranteed
                 at .\compiler\rustc_middle\src\query\inner.rs:73
      76: rustc_middle::query::plumbing::TyCtxtEnsureOk::check_type_wf
                 at .\compiler\rustc_middle\src\query\plumbing.rs:176
      77: rustc_hir_analysis::check_crate::closure$0
                 at .\compiler\rustc_hir_analysis\src\lib.rs:186
      78: rustc_data_structures::profiling::VerboseTimingGuard::run
                 at .\compiler\rustc_data_structures\src\profiling.rs:844
      79: rustc_session::session::Session::time<tuple$<>,rustc_hir_analysis::check_crate::closure_env$0>
                 at .\compiler\rustc_session\src\utils.rs:17
      80: rustc_hir_analysis::check_crate
                 at .\compiler\rustc_hir_analysis\src\lib.rs:181
      81: rustc_interface::passes::run_required_analyses
                 at .\compiler\rustc_interface\src\passes.rs:1089
      82: rustc_interface::passes::analysis
                 at .\compiler\rustc_interface\src\passes.rs:1145
      83: rustc_query_impl::query_impl::analysis::dynamic_query::closure$2::closure$0
                 at .\compiler\rustc_query_impl\src\plumbing.rs:298
          [... omitted 18 frames ...]
      84: rustc_middle::query::inner::query_ensure
                 at .\compiler\rustc_middle\src\query\inner.rs:51
      85: rustc_middle::query::plumbing::TyCtxtEnsureOk::analysis
                 at .\compiler\rustc_middle\src\query\plumbing.rs:173
      86: rustc_driver_impl::run_compiler::closure$0::closure$2
                 at .\compiler\rustc_driver_impl\src\lib.rs:367
      87: rustc_interface::passes::create_and_enter_global_ctxt::closure$2::closure$0
                 at .\compiler\rustc_interface\src\passes.rs:1024
      88: rustc_middle::ty::context::impl$20::enter::closure$1
                 at .\compiler\rustc_middle\src\ty\context.rs:1651
      89: rustc_middle::ty::context::tls::enter_context::closure$0
                 at .\compiler\rustc_middle\src\ty\context\tls.rs:60
      90: std::thread::local::LocalKey::try_with
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\thread\local.rs:508
      91: std::thread::local::LocalKey::with<core::cell::Cell<ptr_const$<tuple$<> > >,rustc_middle::ty::context::tls::enter_context::closure_env$0<rustc_middle::ty::context::impl$20::enter::closure_env$1<rustc_interface::passes::create_and_enter_global_ctxt::closure
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\thread\local.rs:472
      92: rustc_middle::ty::context::tls::enter_context
                 at .\compiler\rustc_middle\src\ty\context\tls.rs:57
      93: rustc_middle::ty::context::GlobalCtxt::enter
                 at .\compiler\rustc_middle\src\ty\context.rs:1651
      94: rustc_middle::ty::context::TyCtxt::create_global_ctxt<enum2$<core::option::Option<rustc_interface::queries::Linker> >,rustc_interface::passes::create_and_enter_global_ctxt::closure$2::closure_env$0<enum2$<core::option::Option<rustc_interface::queries::Link
                 at .\compiler\rustc_middle\src\ty\context.rs:1858
      95: rustc_interface::passes::create_and_enter_global_ctxt::closure$2
                 at .\compiler\rustc_interface\src\passes.rs:991
      96: core::ops::function::FnOnce::call_once<rustc_interface::passes::create_and_enter_global_ctxt::closure_env$2<enum2$<core::option::Option<rustc_interface::queries::Linker> >,rustc_driver_impl::run_compiler::closure$0::closure_env$2>,tuple$<ref$<rustc_session
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\ops\function.rs:250
      97: alloc::boxed::impl$29::call_once<tuple$<ref$<rustc_session::session::Session>,rustc_middle::ty::context::CurrentGcx,alloc::sync::Arc<rustc_data_structures::jobserver::Proxy,alloc::alloc::Global>,ref$<std::sync::once_lock::OnceLock<rustc_middle::ty::context
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\alloc\src\boxed.rs:2005
      98: rustc_interface::passes::create_and_enter_global_ctxt<enum2$<core::option::Option<rustc_interface::queries::Linker> >,rustc_driver_impl::run_compiler::closure$0::closure_env$2>
                 at .\compiler\rustc_interface\src\passes.rs:1032
      99: rustc_driver_impl::run_compiler::closure$0
                 at .\compiler\rustc_driver_impl\src\lib.rs:340
     100: rustc_interface::interface::run_compiler::closure$1::closure$0
                 at .\compiler\rustc_interface\src\interface.rs:543
     101: core::panic::unwind_safe::impl$25::call_once
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\core\src\panic\unwind_safe.rs:274
     102: std::panicking::catch_unwind::do_call
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panicking.rs:590
     103: std::panicking::catch_unwind
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panicking.rs:553
     104: std::panic::catch_unwind
                 at /rustc/3b4dd9bf1410f8da6329baa36ce5e37673cbbd1f\library\std\src\panic.rs:359
     105: rustc_interface::interface::run_compiler::closure$1
                 at .\compiler\rustc_interface\src\interface.rs:543
     106: rustc_interface::util::run_in_thread_pool_with_globals::closure$0
                 at .\compiler\rustc_interface\src\util.rs:209
     107: rustc_interface::util::run_in_thread_with_globals::closure$0::closure$0::closure$0
                 at .\compiler\rustc_interface\src\util.rs:163
     108: scoped_tls::ScopedKey::set<rustc_span::SessionGlobals,rustc_interface::util::run_in_thread_with_globals::closure$0::closure$0::closure_env$0<rustc_interface::util::run_in_thread_pool_with_globals::closure_env$0<rustc_interface::interface::run_compiler::clo
                 at C:\Users\User\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\scoped-tls-1.0.1\src\lib.rs:137
     109: rustc_span::create_session_globals_then<tuple$<>,rustc_interface::util::run_in_thread_with_globals::closure$0::closure$0::closure_env$0<rustc_interface::util::run_in_thread_pool_with_globals::closure_env$0<rustc_interface::interface::run_compiler::closure_
                 at .\compiler\rustc_span\src\lib.rs:143
     110: rustc_interface::util::run_in_thread_with_globals::closure$0::closure$0
                 at .\compiler\rustc_interface\src\util.rs:159
    note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
    
    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: rustc 1.94.0-dev running on x86_64-pc-windows-msvc
    

    it's since: #139558

    EDIT: Oh, it's not exactly the same. created a new issue #149809

  9. reddevilmidzy commented on Jun 12, 2026

    @reddevilmidzy
    Member

    new program output

    warning: the feature `min_generic_const_args` is incomplete and may not be safe to use and/or cause compiler crashes
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:1:12
      |
    1 | #![feature(min_generic_const_args)]
      |            ^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: see issue #132980 <https://github.com/rust-lang/rust/issues/132980> for more information
      = note: `#[warn(incomplete_features)]` on by default
    
    warning: the feature `inherent_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:2:12
      |
    2 | #![feature(inherent_associated_types)]
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^
      |
      = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
    
    warning: struct `Foo` is never constructed
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:3:8
      |
    3 | struct Foo<'a> {
      |        ^^^
      |
      = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default
    
    warning: associated function `Foo` is never used
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:7:8
      |
    6 | impl<'a> Foo<'a> {
      | ---------------- associated function in this implementation
    7 |     fn Foo(_: [u8; Foo::X]) {}
      |        ^^^
    
    warning: method `Foo` should have a snake case name
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:7:8
      |
    7 |     fn Foo(_: [u8; Foo::X]) {}
      |        ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
      |
      = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default
    
    warning: 5 warnings emitted
    
    note: no errors encountered even though delayed bugs were created
    
    note: those delayed bugs will now be shown as internal compiler errors
    
    error: internal compiler error: inferred lifetime in signature
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:7:20
      |
    7 |     fn Foo(_: [u8; Foo::X]) {}
      |                    ^^^
      |
    note: delayed at /rustc-dev/32cfe53009803b85afd40ff72768bb058e9936f0/compiler/rustc_hir_analysis/src/collect.rs:364:13
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
             1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
             2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
             3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, &str>
             4: <rustc_hir_analysis::collect::ItemCtxt as rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::re_infer
             5: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_lifetime
             6: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_generic_args_of_path::{closure#0}
             7: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty
             8: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_const_arg
             9: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_ty
            10: <dyn rustc_hir_analysis::hir_ty_lowering::HirTyLowerer>::lower_fn_ty
            11: rustc_hir_analysis::collect::lower_fn_sig_recovering_infer_ret_ty
            12: rustc_hir_analysis::collect::fn_sig
            13: rustc_query_impl::query_impl::fn_sig::invoke_provider_fn::__rust_begin_short_backtrace
            14: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 24]>>, false>
            15: rustc_query_impl::query_impl::fn_sig::execute_query_non_incr::__rust_end_short_backtrace
            16: <rustc_hir_analysis::variance::constraints::ConstraintContext>::build_constraints_for_item
            17: rustc_hir_analysis::variance::crate_variances
            18: rustc_query_impl::query_impl::crate_variances::invoke_provider_fn::__rust_begin_short_backtrace
            19: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 8]>>, false>
            20: rustc_query_impl::query_impl::crate_variances::execute_query_non_incr::__rust_end_short_backtrace
            21: rustc_query_impl::query_impl::variances_of::invoke_provider_fn::__rust_begin_short_backtrace.warm
            22: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::DefIdCache<rustc_middle::query::erase::ErasedData<[u8; 16]>>, false>
            23: rustc_query_impl::query_impl::variances_of::execute_query_non_incr::__rust_end_short_backtrace
            24: rustc_hir_analysis::check::wfcheck::check_variances_for_type_defn
            25: rustc_hir_analysis::check::check::check_item_type
            26: rustc_hir_analysis::check::wfcheck::check_well_formed
            27: rustc_query_impl::query_impl::check_well_formed::invoke_provider_fn::__rust_begin_short_backtrace
            28: rustc_query_impl::execution::try_execute_query::<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::ErasedData<[u8; 1]>, rustc_middle::dep_graph::graph::DepNodeIndex>, false>
            29: rustc_query_impl::query_impl::check_well_formed::execute_query_non_incr::__rust_end_short_backtrace
            30: rustc_hir_analysis::check::wfcheck::check_type_wf
            31: rustc_query_impl::query_impl::check_type_wf::invoke_provider_fn::__rust_begin_short_backtrace
            32: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 1]>>, false>
            33: rustc_query_impl::query_impl::check_type_wf::execute_query_non_incr::__rust_end_short_backtrace
            34: rustc_hir_analysis::check_crate
            35: rustc_interface::passes::analysis
            36: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
            37: rustc_query_impl::query_impl::analysis::execute_query_non_incr::__rust_end_short_backtrace
            38: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
            39: std::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
            40: <std::thread::lifecycle::spawn_unchecked<rustc_interface::util::run_in_thread_with_globals<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            41: <std::sys::thread::unix::Thread>::new::thread_start
            42: <unknown>
            43: <unknown>
          
     --> /tmp/icemaker_global_tempdir.mByXmACgKZhf/rustc_testrunner_tmpdir_reporting.r4eRQ4q3X7z9/mvce.rs:7:20
      |
    7 |     fn Foo(_: [u8; Foo::X]) {}
      |                    ^^^
    
    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: rustc 1.98.0-nightly (32cfe5300 2026-06-11) running on x86_64-unknown-linux-gnu
    
    query stack during panic:
    end of query stack
    
  10. changed the title [-]ICE `unelided lifetime in signature`[/-] [+]ICE `inferred lifetime in signature`[/+] on Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-gca_min_const_items`#![feature(gca_min_const_items)]` (previously: `min_generic_const_args`)F-inherent_associated_types`#![feature(inherent_associated_types)]`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

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions