Skip to content

ICE: cannot convert "'a/#4" to a region vid #131295

Closed

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

#![feature(generic_const_exprs)]
trait MyTrait<T, U: From<T>> {}

impl<'a, 'b, T, U> MyTrait<T> for U {
    async fn foo(
        _: T,
    ) -> (
        &'a U,
        &'static dyn MyTrait<
            [(); {
                |x: &'a u32| x;
                4
            }],
        >,
    ) {
    }
}

original:

trait MyTrait<T, U: From<T>> {
    async fn foo(&'a self, key: &'b T) -> (&'a ConnImpl, &'b T);
}

impl<'a, 'b, T, U> MyTrait<T> for U {
    async fn foo(_: T) -> (&'a U, &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]>) {}
}

Version information

rustc 1.83.0-nightly (5a4ee43c3 2024-10-05)
binary: rustc
commit-hash: 5a4ee43c387110736440cecc375cb5aedc441dbc
commit-date: 2024-10-05
host: x86_64-unknown-linux-gnu
release: 1.83.0-nightly
LLVM version: 19.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(generic_const_exprs)

Program output

error[E0670]: `async fn` is not permitted in Rust 2015
 --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:4:5
  |
4 |     async fn foo(
  |     ^^^^^ to use `async fn`, switch to Rust 2018 or later
  |
  = help: pass `--edition 2021` to `rustc`
  = note: for more on editions, read https://doc.rust-lang.org/edition-guide

error[E0407]: method `foo` is not a member of trait `MyTrait`
  --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:4:5
   |
4  | /     async fn foo(
5  | |         _: T,
6  | |     ) -> (
7  | |         &'a U,
...  |
14 | |     ) {
15 | |     }
   | |_____^ not a member of trait `MyTrait`

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <crate attribute>:1:9
  |
1 | feature(generic_const_exprs)
  |         ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:16:2
   |
16 | }
   |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs`

error[E0107]: trait takes 2 generic arguments but 1 generic argument was supplied
 --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:3:20
  |
3 | impl<'a, 'b, T, U> MyTrait<T> for U {
  |                    ^^^^^^^ - supplied 1 generic argument
  |                    |
  |                    expected 2 generic arguments
  |
note: trait defined here, with 2 generic parameters: `T`, `U`
 --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:1:7
  |
1 | trait MyTrait<T, U: From<T>> {}
  |       ^^^^^^^ -  -
help: add missing generic argument
  |
3 | impl<'a, 'b, T, U> MyTrait<T, U> for U {
  |                             +++

error[E0107]: trait takes 2 generic arguments but 1 generic argument was supplied
  --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:8:22
   |
8  |           &'static dyn MyTrait<
   |                        ^^^^^^^ expected 2 generic arguments
9  | /             [(); {
10 | |                 |x: &'a u32| x;
11 | |                 4
12 | |             }],
   | |______________- supplied 1 generic argument
   |
note: trait defined here, with 2 generic parameters: `T`, `U`
  --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:1:7
   |
1  | trait MyTrait<T, U: From<T>> {}
   |       ^^^^^^^ -  -
help: add missing generic argument
   |
12 |             }], U,
   |               +++

error: overly complex generic constant
  --> /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:9:18
   |
9  |               [(); {
   |  __________________^
10 | |                 |x: &'a u32| x;
11 | |                 4
12 | |             }],
   | |_____________^ blocks are not supported in generic constants
   |
   = help: consider moving this anonymous constant into a `const` function
   = note: this operation may be supported in the future

error: internal compiler error: compiler/rustc_borrowck/src/universal_regions.rs:907:36: cannot convert `'a/#4` to a region vid

thread 'rustc' panicked at compiler/rustc_borrowck/src/universal_regions.rs:907:36:
Box<dyn Any>
stack backtrace:
   0:     0x7b70b45249fa - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h585b06d402bc00d5
   1:     0x7b70b4c03426 - core::fmt::write::h62d1c51a5a367817
   2:     0x7b70b5e1a651 - std::io::Write::write_fmt::hd7881933ac2a1e16
   3:     0x7b70b4524852 - std::sys::backtrace::BacktraceLock::print::ha0ac5d8e3803f857
   4:     0x7b70b4526d26 - std::panicking::default_hook::{{closure}}::h7a48a96dd6d0b686
   5:     0x7b70b4526b70 - std::panicking::default_hook::h4ad77b5924a748da
   6:     0x7b70b35db8ff - std[f6927571c1bb7893]::panicking::update_hook::<alloc[1b6d6df6cca9b2d3]::boxed::Box<rustc_driver_impl[83de0f0d7a3bbaf8]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x7b70b4527438 - std::panicking::rust_panic_with_hook::h15ea114d0f0705b7
   8:     0x7b70b3615451 - std[f6927571c1bb7893]::panicking::begin_panic::<rustc_errors[33bfe5951055d2f3]::ExplicitBug>::{closure#0}
   9:     0x7b70b36084f6 - std[f6927571c1bb7893]::sys::backtrace::__rust_end_short_backtrace::<std[f6927571c1bb7893]::panicking::begin_panic<rustc_errors[33bfe5951055d2f3]::ExplicitBug>::{closure#0}, !>
  10:     0x7b70b36084b3 - std[f6927571c1bb7893]::panicking::begin_panic::<rustc_errors[33bfe5951055d2f3]::ExplicitBug>
  11:     0x7b70b361ece1 - <rustc_errors[33bfe5951055d2f3]::diagnostic::BugAbort as rustc_errors[33bfe5951055d2f3]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  12:     0x7b70b3c49ca4 - rustc_middle[4aa8808438232afe]::util::bug::opt_span_bug_fmt::<rustc_span[b73f4c38f6b79966]::span_encoding::Span>::{closure#0}
  13:     0x7b70b3c2fb1a - rustc_middle[4aa8808438232afe]::ty::context::tls::with_opt::<rustc_middle[4aa8808438232afe]::util::bug::opt_span_bug_fmt<rustc_span[b73f4c38f6b79966]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  14:     0x7b70b3c2f9ab - rustc_middle[4aa8808438232afe]::ty::context::tls::with_context_opt::<rustc_middle[4aa8808438232afe]::ty::context::tls::with_opt<rustc_middle[4aa8808438232afe]::util::bug::opt_span_bug_fmt<rustc_span[b73f4c38f6b79966]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  15:     0x7b70b11daa80 - rustc_middle[4aa8808438232afe]::util::bug::bug_fmt
  16:     0x7b70b5449263 - <rustc_borrowck[2a33a37890e0dae7]::type_check::TypeChecker>::push_region_constraints
  17:     0x7b70b5960200 - <rustc_borrowck[2a33a37890e0dae7]::type_check::TypeChecker>::ascribe_user_type_skip_wf
  18:     0x7b70b5c950cd - rustc_borrowck[2a33a37890e0dae7]::type_check::type_check
  19:     0x7b70b4cccfdf - rustc_borrowck[2a33a37890e0dae7]::nll::compute_regions
  20:     0x7b70b5be5975 - rustc_borrowck[2a33a37890e0dae7]::do_mir_borrowck
  21:     0x7b70b5bd7b07 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  22:     0x7b70b502373a - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  23:     0x7b70b5023193 - rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  24:     0x7b70b58d6f06 - rustc_middle[4aa8808438232afe]::query::plumbing::query_get_at::<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>>
  25:     0x7b70b58d6f5a - <rustc_borrowck[2a33a37890e0dae7]::type_check::TypeChecker>::prove_closure_bounds
  26:     0x7b70b4df8d5d - <rustc_borrowck[2a33a37890e0dae7]::type_check::TypeChecker>::typeck_mir
  27:     0x7b70b5c93ec4 - rustc_borrowck[2a33a37890e0dae7]::type_check::type_check
  28:     0x7b70b4cccfdf - rustc_borrowck[2a33a37890e0dae7]::nll::compute_regions
  29:     0x7b70b5be5975 - rustc_borrowck[2a33a37890e0dae7]::do_mir_borrowck
  30:     0x7b70b5bd7b07 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  31:     0x7b70b502373a - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  32:     0x7b70b5023193 - rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
  33:     0x7b70b54e4ca8 - rustc_mir_transform[e62bc607d4a6429b]::mir_drops_elaborated_and_const_checked
  34:     0x7b70b54e42d5 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  35:     0x7b70b502373a - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  36:     0x7b70b50230e5 - rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
  37:     0x7b70b4eab0f1 - rustc_mir_transform[e62bc607d4a6429b]::mir_for_ctfe
  38:     0x7b70b4eaaf9b - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_for_ctfe::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  39:     0x7b70b4c2f378 - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefIdCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  40:     0x7b70b527f73d - rustc_query_impl[7b31fe52c1943d23]::query_impl::mir_for_ctfe::get_query_non_incr::__rust_end_short_backtrace
  41:     0x7b70b527f87e - <rustc_const_eval[31692a344d8da780]::interpret::eval_context::InterpCx<rustc_const_eval[31692a344d8da780]::const_eval::machine::CompileTimeMachine>>::load_mir
  42:     0x7b70b26552ad - rustc_const_eval[31692a344d8da780]::const_eval::eval_queries::eval_to_allocation_raw_provider
  43:     0x7b70b528e836 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::eval_to_allocation_raw::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 24usize]>>
  44:     0x7b70b528e05a - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefaultCache<rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::mir::interpret::GlobalId>, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  45:     0x7b70b528dc2f - rustc_query_impl[7b31fe52c1943d23]::query_impl::eval_to_allocation_raw::get_query_non_incr::__rust_end_short_backtrace
  46:     0x7b70b52a796b - rustc_const_eval[31692a344d8da780]::const_eval::valtrees::eval_to_valtree
  47:     0x7b70b52a777f - <rustc_const_eval[31692a344d8da780]::provide::{closure#0} as core[e1b34d82e9cff2ed]::ops::function::FnOnce<(rustc_middle[4aa8808438232afe]::ty::context::TyCtxt, rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::mir::interpret::GlobalId>)>>::call_once
  48:     0x7b70b52a7736 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::eval_to_valtree::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 24usize]>>
  49:     0x7b70b52a76ef - <rustc_query_impl[7b31fe52c1943d23]::query_impl::eval_to_valtree::dynamic_query::{closure#2} as core[e1b34d82e9cff2ed]::ops::function::FnOnce<(rustc_middle[4aa8808438232afe]::ty::context::TyCtxt, rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::mir::interpret::GlobalId>)>>::call_once
  50:     0x7b70b528e12e - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefaultCache<rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::mir::interpret::GlobalId>, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 24usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  51:     0x7b70b528da48 - rustc_query_impl[7b31fe52c1943d23]::query_impl::eval_to_valtree::get_query_non_incr::__rust_end_short_backtrace
  52:     0x7b70b56ffb44 - rustc_middle[4aa8808438232afe]::query::plumbing::query_get_at::<rustc_query_system[af74fb06ba218297]::query::caches::DefaultCache<rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::mir::interpret::GlobalId>, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 24usize]>>>
  53:     0x7b70b56ff5a2 - <rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>::const_eval_global_id_for_typeck
  54:     0x7b70b56fe4be - <rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>::const_eval_resolve_for_typeck
  55:     0x7b70b56fe107 - <rustc_middle[4aa8808438232afe]::ty::consts::Const>::normalize
  56:     0x7b70b56fd999 - <rustc_trait_selection[d03aaefc9e43bec8]::traits::query::normalize::QueryNormalizer as rustc_type_ir[e4a03ddda3530d0c]::fold::FallibleTypeFolder<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_fold_const
  57:     0x7b70b549c80e - <rustc_traits[c2b3970266ec5fb3]::normalize_erasing_regions::provide::{closure#0} as core[e1b34d82e9cff2ed]::ops::function::FnOnce<(rustc_middle[4aa8808438232afe]::ty::context::TyCtxt, rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::ty::generic_args::GenericArg>)>>::call_once
  58:     0x7b70b549b86f - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::try_normalize_generic_arg_after_erasing_regions::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  59:     0x7b70b549af64 - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefaultCache<rustc_middle[4aa8808438232afe]::ty::ParamEnvAnd<rustc_middle[4aa8808438232afe]::ty::generic_args::GenericArg>, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  60:     0x7b70b549aca0 - rustc_query_impl[7b31fe52c1943d23]::query_impl::try_normalize_generic_arg_after_erasing_regions::get_query_non_incr::__rust_end_short_backtrace
  61:     0x7b70b5e00214 - <rustc_middle[4aa8808438232afe]::ty::normalize_erasing_regions::TryNormalizeAfterErasingRegionsFolder as rustc_type_ir[e4a03ddda3530d0c]::fold::FallibleTypeFolder<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_fold_const
  62:     0x7b70b3946f84 - <rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeFolder<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::fold_const
  63:     0x7b70b385a232 - <rustc_middle[4aa8808438232afe]::ty::Ty as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeSuperFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  64:     0x7b70b3853afd - <&rustc_middle[4aa8808438232afe]::ty::list::RawList<(), rustc_middle[4aa8808438232afe]::ty::generic_args::GenericArg> as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  65:     0x7b70b384a6db - <rustc_type_ir[e4a03ddda3530d0c]::predicate::ExistentialPredicate<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt> as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  66:     0x7b70b385a09f - <rustc_middle[4aa8808438232afe]::ty::Ty as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeSuperFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  67:     0x7b70b385a265 - <rustc_middle[4aa8808438232afe]::ty::Ty as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeSuperFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  68:     0x7b70b385798e - <&rustc_middle[4aa8808438232afe]::ty::list::RawList<(), rustc_middle[4aa8808438232afe]::ty::Ty> as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  69:     0x7b70b385a2f3 - <rustc_middle[4aa8808438232afe]::ty::Ty as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeSuperFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  70:     0x7b70b3853805 - <&rustc_middle[4aa8808438232afe]::ty::list::RawList<(), rustc_middle[4aa8808438232afe]::ty::generic_args::GenericArg> as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  71:     0x7b70b385a1cb - <rustc_middle[4aa8808438232afe]::ty::Ty as rustc_type_ir[e4a03ddda3530d0c]::fold::TypeSuperFoldable<rustc_middle[4aa8808438232afe]::ty::context::TyCtxt>>::try_super_fold_with::<rustc_hir_typeck[e4dc2722ad721e99]::writeback::EagerlyNormalizeConsts>
  72:     0x7b70b5755e1c - <rustc_hir_typeck[e4dc2722ad721e99]::writeback::WritebackCx>::visit_node_id
  73:     0x7b70b1861fdf - <rustc_hir_typeck[e4dc2722ad721e99]::writeback::WritebackCx as rustc_hir[8ec93e1cc47b7a03]::intravisit::Visitor>::visit_expr
  74:     0x7b70b574c640 - <rustc_hir_typeck[e4dc2722ad721e99]::fn_ctxt::FnCtxt>::resolve_type_vars_in_body
  75:     0x7b70b4f363df - rustc_hir_typeck[e4dc2722ad721e99]::typeck
  76:     0x7b70b4f351cf - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  77:     0x7b70b502373a - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  78:     0x7b70b502249b - rustc_query_impl[7b31fe52c1943d23]::query_impl::typeck::get_query_non_incr::__rust_end_short_backtrace
  79:     0x7b70b553763f - rustc_middle[4aa8808438232afe]::query::plumbing::query_get_at::<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>>
  80:     0x7b70b5b479eb - rustc_hir_analysis[2ca7e8779feeb593]::collect::type_of::type_of_opaque
  81:     0x7b70b5b47925 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  82:     0x7b70b4c2f378 - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefIdCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  83:     0x7b70b5d8ad46 - rustc_query_impl[7b31fe52c1943d23]::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
  84:     0x7b70b5646540 - rustc_middle[4aa8808438232afe]::query::plumbing::query_get_at::<rustc_query_system[af74fb06ba218297]::query::caches::DefIdCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>>
  85:     0x7b70b24f38da - rustc_hir_analysis[2ca7e8779feeb593]::collect::type_of::type_of
  86:     0x7b70b4c30670 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>
  87:     0x7b70b4c2f378 - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefIdCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  88:     0x7b70b4c2ef31 - rustc_query_impl[7b31fe52c1943d23]::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
  89:     0x7b70b5646540 - rustc_middle[4aa8808438232afe]::query::plumbing::query_get_at::<rustc_query_system[af74fb06ba218297]::query::caches::DefIdCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 8usize]>>>
  90:     0x7b70b5b51c80 - rustc_hir_analysis[2ca7e8779feeb593]::check::check::check_item_type
  91:     0x7b70b2533af6 - rustc_hir_analysis[2ca7e8779feeb593]::check::wfcheck::check_well_formed
  92:     0x7b70b570902b - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>
  93:     0x7b70b5708791 - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  94:     0x7b70b5708410 - rustc_query_impl[7b31fe52c1943d23]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  95:     0x7b70b57090bd - rustc_middle[4aa8808438232afe]::query::plumbing::query_ensure_error_guaranteed::<rustc_query_system[af74fb06ba218297]::query::caches::VecCache<rustc_span[b73f4c38f6b79966]::def_id::LocalDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>, ()>
  96:     0x7b70b570969d - rustc_hir_analysis[2ca7e8779feeb593]::check::wfcheck::check_mod_type_wf
  97:     0x7b70b57090e5 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>
  98:     0x7b70b570297b - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::DefaultCache<rustc_span[b73f4c38f6b79966]::def_id::LocalModDefId, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
  99:     0x7b70b570272d - rustc_query_impl[7b31fe52c1943d23]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
 100:     0x7b70b501fd3b - rustc_hir_analysis[2ca7e8779feeb593]::check_crate
 101:     0x7b70b501ca97 - rustc_interface[a7beddea6b2aa80d]::passes::run_required_analyses
 102:     0x7b70b59f6f9e - rustc_interface[a7beddea6b2aa80d]::passes::analysis
 103:     0x7b70b59f6f71 - rustc_query_impl[7b31fe52c1943d23]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[7b31fe52c1943d23]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>
 104:     0x7b70b5ad31ee - rustc_query_system[af74fb06ba218297]::query::plumbing::try_execute_query::<rustc_query_impl[7b31fe52c1943d23]::DynamicConfig<rustc_query_system[af74fb06ba218297]::query::caches::SingleCache<rustc_middle[4aa8808438232afe]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[7b31fe52c1943d23]::plumbing::QueryCtxt, false>
 105:     0x7b70b5ad2ecf - rustc_query_impl[7b31fe52c1943d23]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
 106:     0x7b70b592151e - rustc_interface[a7beddea6b2aa80d]::interface::run_compiler::<core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>, rustc_driver_impl[83de0f0d7a3bbaf8]::run_compiler::{closure#0}>::{closure#1}
 107:     0x7b70b59d9150 - std[f6927571c1bb7893]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_with_globals<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_pool_with_globals<rustc_interface[a7beddea6b2aa80d]::interface::run_compiler<core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>, rustc_driver_impl[83de0f0d7a3bbaf8]::run_compiler::{closure#0}>::{closure#1}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>
 108:     0x7b70b59d9817 - <<std[f6927571c1bb7893]::thread::Builder>::spawn_unchecked_<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_with_globals<rustc_interface[a7beddea6b2aa80d]::util::run_in_thread_pool_with_globals<rustc_interface[a7beddea6b2aa80d]::interface::run_compiler<core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>, rustc_driver_impl[83de0f0d7a3bbaf8]::run_compiler::{closure#0}>::{closure#1}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e1b34d82e9cff2ed]::result::Result<(), rustc_span[b73f4c38f6b79966]::ErrorGuaranteed>>::{closure#1} as core[e1b34d82e9cff2ed]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
 109:     0x7b70b59da701 - std::sys::pal::unix::thread::Thread::new::thread_start::h4498a525a6fc6a9e
 110:     0x7b70b70ec39d - <unknown>
 111:     0x7b70b717149c - <unknown>
 112:                0x0 - <unknown>

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.83.0-nightly (5a4ee43c3 2024-10-05) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z crate-attr=feature(generic_const_exprs) -Z dump-mir-dir=dir

query stack during panic:
#0 [mir_borrowck] borrow-checking `<impl at /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:3:1: 3:36>::foo::{opaque#0}::{constant#0}::{closure#0}`
#1 [mir_borrowck] borrow-checking `<impl at /tmp/icemaker_global_tempdir.eYWrWaRW6iTh/rustc_testrunner_tmpdir_reporting.zSc9AlIqfGJ5/mvce.rs:3:1: 3:36>::foo::{opaque#0}::{constant#0}`
end of query stack
error: aborting due to 7 previous errors; 1 warning emitted

Some errors have detailed explanations: E0107, E0407, E0601, E0670.
For more information about an error, try `rustc --explain E0107`.

@rustbot label +F-generic_const_exprs

Activity

  1. added
    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.
    on Oct 5, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 5, 2024
  3. cyrgani commented on Oct 6, 2024

    @cyrgani
    Contributor

    Reduced:

    #![feature(generic_const_exprs)]
    
    async fn foo<'a>() -> [(); {
           let _y: &'a ();
           4
       }] {
    }

    @rustbot label:+S-has-mcve

  4. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    on Oct 6, 2024
  5. matthiaskrgr commented on Oct 8, 2024

    @matthiaskrgr
    MemberAuthor

    this bisects to #129244 cc @cjgillot

  6. self-assigned this
    on Oct 11, 2024
  7. added
    S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.
    on Oct 12, 2024
  8. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Oct 15, 2024
  9. matthiaskrgr commented on Nov 25, 2024

    @matthiaskrgr
    Author
  10. cyrgani commented on Dec 1, 2024

    @cyrgani
  11. jieyouxu commented on Dec 2, 2024

    @jieyouxu
  12. lqd commented on Dec 26, 2024

    @lqd
    Member

    These last 3 examples have different backtraces and look different though? They look like issues with shadowed lifetimes and region remapping and should be related to #129383.

  13. jieyouxu commented on Dec 26, 2024

    @jieyouxu
    Member

    Hmm, good point, might need re-triaging.

  14. lqd commented on Dec 26, 2024

    @lqd
    Member

    They look close to #132766 at least

  15. added a commit that references this issue on Nov 2, 2025
    056f32c
  16. added a commit that references this issue on Nov 2, 2025
    1d64a4b
  17. added a commit that references this issue on Nov 2, 2025
    ec576bb
  18. added a commit that references this issue on Nov 2, 2025
    0bf4278
  19. added a commit that references this issue on Nov 3, 2025
    9df48c5
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-generic_const_exprs`#![feature(generic_const_exprs)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️S-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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