Skip to content

ICEs (in debug mode) due to RBV not expanding trait aliases when collecting bound vars from supertrait bounds #152244

@fmease

Description

@fmease

1st reproducer:

#![feature(trait_alias)]

trait A<'a> { type X; }
trait B: for<'a> A<'a> {}
trait C = B;
fn f<T>() where T: C<X: Copy> {}

Compiler panic message w/o backtrace:

thread 'rustc' (47550) panicked at compiler/rustc_type_ir/src/binder.rs:345:21:
Not enough bound vars: '^0.Named(DefId(0:7 ~ t0[6b76]::B::'a)) not found in []
Backtrace
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:689:5
   1: core::panicking::panic_fmt
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panicking.rs:80:14
   2: visit_region<rustc_middle::ty::context::TyCtxt>
             at ./compiler/rustc_type_ir/src/binder.rs:345:21
   3: visit_with<rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:353:48
   4: visit_with<rustc_middle::ty::generic_args::GenericArg, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:707:9
   5: visit_with<rustc_middle::ty::context::TyCtxt, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_type_ir/src/ty_kind.rs:398:10
   6: visit_ty<rustc_middle::ty::context::TyCtxt>
             at ./compiler/rustc_type_ir/src/binder.rs:317:11
   7: visit_with<rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:354:44
   8: visit_with<rustc_middle::ty::generic_args::GenericArg, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:707:9
   9: visit_with<rustc_middle::ty::context::TyCtxt, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_type_ir/src/predicate.rs:57:10
  10: bind_with_vars<rustc_middle::ty::context::TyCtxt, rustc_type_ir::predicate::TraitRef<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_type_ir/src/binder.rs:113:27
  11: lower_poly_trait_ref
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:946:30
  12: lower_bounds<&[rustc_hir::hir::GenericBound]>
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs:387:34
  13: lower_assoc_item_constraint
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs:648:30
  14: lower_poly_trait_ref
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:1072:54
  15: lower_bounds<&[rustc_hir::hir::GenericBound]>
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs:387:34
  16: {closure#0}
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:285:31
  17: gather_explicit_predicates_of
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:82:1
  18: explicit_predicates_of
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:595:9
  19: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:286:13
      [... omitted 22 frames ...]
  20: query_get_at<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 24]>>>
             at ./compiler/rustc_middle/src/query/inner.rs:33:17
  21: explicit_predicates_of<rustc_span::def_id::DefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:411:31
  22: explicit_predicates_of<rustc_span::def_id::DefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:402:35
  23: predicates_of
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:30:26
  24: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  25: query_ensure<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 24]>>>
             at ./compiler/rustc_middle/src/query/inner.rs:51:9
  26: predicates_of<rustc_span::def_id::LocalDefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:173:9
  27: check_item_type
             at ./compiler/rustc_hir_analysis/src/check/check.rs:792:29
  28: check_well_formed
             at ./compiler/rustc_hir_analysis/src/check/wfcheck.rs:197:19
  29: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  30: query_ensure_error_guaranteed<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>, ()>
             at ./compiler/rustc_middle/src/query/inner.rs:73:9
  31: check_well_formed<rustc_span::def_id::LocalDefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:176:9
  32: {closure#0}
             at ./compiler/rustc_hir_analysis/src/check/wfcheck.rs:2309:43
  33: {closure#0}<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure_env#0}>
             at ./compiler/rustc_middle/src/hir/mod.rs:113:58
  34: {closure#0}<&[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:212:55
  35: call_once<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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 /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panic/unwind_safe.rs:274:9
  36: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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}>>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:581:40
  37: catch_unwind<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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 /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:544:19
  38: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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}>>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panic.rs:359:14
  39: run<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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:23:9
  40: {closure#1}<&[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:212:48
  41: {closure#0}<&rustc_hir::hir::ItemId, core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure_env#1}<&[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}>>, fn(core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>) -> core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/iter/adapters/filter_map.rs:39:28
  42: fold<rustc_hir::hir::ItemId, core::result::Result<(), rustc_span::ErrorGuaranteed>, core::iter::adapters::filter_map::filter_map_fold::{closure_env#0}<&rustc_hir::hir::ItemId, core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure_env#1}<&[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}>>, fn(core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>) -> core::result::Result<(), rustc_span::ErrorGuaranteed>>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/slice/iter/macros.rs:279:27
  43: fold<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::slice::iter::Iter<rustc_hir::hir::ItemId>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure_env#1}<&[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}>>, core::result::Result<(), rustc_span::ErrorGuaranteed>, fn(core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>) -> core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/iter/adapters/filter_map.rs:146:19
  44: {closure#0}<&[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:212:70
  45: parallel_guard<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure_env#0}<&[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:39:15
  46: try_par_for_each_in<&[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:5
  47: <rustc_middle::hir::ModuleItems>::par_items::<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure#0}>
             at ./compiler/rustc_middle/src/hir/mod.rs:113:9
  48: check_type_wf
             at ./compiler/rustc_hir_analysis/src/check/wfcheck.rs:2309:10
  49: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  50: query_ensure_error_guaranteed<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, ()>
             at ./compiler/rustc_middle/src/query/inner.rs:73:9
  51: check_type_wf
             at ./compiler/rustc_middle/src/query/plumbing.rs:176:9
  52: {closure#0}
             at ./compiler/rustc_hir_analysis/src/lib.rs:183:36
  53: run<(), rustc_hir_analysis::check_crate::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/profiling.rs:844:9
  54: time<(), rustc_hir_analysis::check_crate::{closure_env#0}>
             at ./compiler/rustc_session/src/utils.rs:17:50
  55: check_crate
             at ./compiler/rustc_hir_analysis/src/lib.rs:178:14
  56: run_required_analyses
             at ./compiler/rustc_interface/src/passes.rs:1087:5
  57: analysis
             at ./compiler/rustc_interface/src/passes.rs:1143:5
  58: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  59: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
             at ./compiler/rustc_middle/src/query/inner.rs:51:9
  60: analysis
             at ./compiler/rustc_middle/src/query/plumbing.rs:173:9
  61: {closure#2}
             at ./compiler/rustc_driver_impl/src/lib.rs:375:29
  62: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:1019:27
  63: {closure#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context.rs:1643:37
  64: {closure#0}<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:60:9
  65: try_with<core::cell::Cell<*const ()>, 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#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/thread/local.rs:513:12
  66: with<core::cell::Cell<*const ()>, 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#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/thread/local.rs:477:20
  67: enter_context<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:57:9
  68: enter<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context.rs:1643:9
  69: create_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>>
             at ./compiler/rustc_middle/src/ty/context.rs:1850:13
  70: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:986:9
  71: call_once<rustc_interface::passes::create_and_enter_global_ctxt::{closure_env#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, (&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &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_env#2})>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/ops/function.rs:250:5
  72: call_once<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &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_env#2}), dyn core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &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_env#2}), Output=core::option::Option<rustc_interface::queries::Linker>>, alloc::alloc::Global>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/alloc/src/boxed.rs:2206:9
  73: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:1027:5
  74: {closure#0}
             at ./compiler/rustc_driver_impl/src/lib.rs:348:22
  75: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:532:80
  76: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panic/unwind_safe.rs:274:9
  77: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:581:40
  78: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:544:19
  79: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panic.rs:359:14
  80: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:532:23
  81: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
             at ./compiler/rustc_interface/src/util.rs:204:17
  82: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at ./compiler/rustc_interface/src/util.rs:158:24
  83: 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::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>, ()>
             at /home/fmease/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
  84: create_session_globals_then<(), 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_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>>
             at ./compiler/rustc_span/src/lib.rs:143:21
  85: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at ./compiler/rustc_interface/src/util.rs:154:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: rustc 1.95.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z unstable-options

query stack during panic:
#0 [explicit_predicates_of] computing explicit predicates of `f`
#1 [predicates_of] computing predicates of `f`
#2 [check_well_formed] checking that `f` is well-formed
#3 [check_type_wf] checking that types are well-formed
#4 [analysis] running analysis passes on crate `t0`
end of query stack

2nd reproducer:

#![feature(trait_alias)]

trait A<'a> { type X; }
trait B: for<'a> A<'a> {}
trait C = B;
fn f<T>() where T: C<X: for<'r> A<'r>> {}

Compiler panic message w/o backtrace:

thread 'rustc' (47521) panicked at compiler/rustc_middle/src/ty/region.rs:485:9:
assertion `left == right` failed
  left: BrNamed(DefId(0:7 ~ t1[b9f6]::B::'a))
 right: BrNamed(DefId(0:11 ~ t1[b9f6]::f::'r))
Backtrace
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:689:5
   1: core::panicking::panic_fmt
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panicking.rs:80:14
   2: core::panicking::assert_failed_inner
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panicking.rs:439:17
   3: core::panicking::assert_failed::<rustc_middle::ty::region::BoundRegionKind, rustc_middle::ty::region::BoundRegionKind>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panicking.rs:394:5
   4: assert_eq
             at ./compiler/rustc_middle/src/ty/region.rs:485:9
   5: visit_region<rustc_middle::ty::context::TyCtxt>
             at ./compiler/rustc_type_ir/src/binder.rs:347:20
   6: visit_with<rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:353:48
   7: visit_with<rustc_middle::ty::generic_args::GenericArg, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:707:9
   8: visit_with<rustc_middle::ty::context::TyCtxt, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_type_ir/src/ty_kind.rs:398:10
   9: visit_ty<rustc_middle::ty::context::TyCtxt>
             at ./compiler/rustc_type_ir/src/binder.rs:317:11
  10: visit_with<rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:354:44
  11: visit_with<rustc_middle::ty::generic_args::GenericArg, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_middle/src/ty/generic_args.rs:707:9
  12: visit_with<rustc_middle::ty::context::TyCtxt, rustc_type_ir::binder::ValidateBoundVars<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_type_ir/src/predicate.rs:57:10
  13: bind_with_vars<rustc_middle::ty::context::TyCtxt, rustc_type_ir::predicate::TraitRef<rustc_middle::ty::context::TyCtxt>>
             at ./compiler/rustc_type_ir/src/binder.rs:113:27
  14: lower_poly_trait_ref
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:946:30
  15: lower_bounds<&[rustc_hir::hir::GenericBound]>
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs:387:34
  16: lower_assoc_item_constraint
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs:648:30
  17: lower_poly_trait_ref
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs:1072:54
  18: lower_bounds<&[rustc_hir::hir::GenericBound]>
             at ./compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs:387:34
  19: {closure#0}
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:285:31
  20: gather_explicit_predicates_of
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:82:1
  21: explicit_predicates_of
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:595:9
  22: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:286:13
      [... omitted 22 frames ...]
  23: query_get_at<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 24]>>>
             at ./compiler/rustc_middle/src/query/inner.rs:33:17
  24: explicit_predicates_of<rustc_span::def_id::DefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:411:31
  25: explicit_predicates_of<rustc_span::def_id::DefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:402:35
  26: predicates_of
             at ./compiler/rustc_hir_analysis/src/collect/predicates_of.rs:30:26
  27: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  28: query_ensure<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 24]>>>
             at ./compiler/rustc_middle/src/query/inner.rs:51:9
  29: predicates_of<rustc_span::def_id::LocalDefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:173:9
  30: check_item_type
             at ./compiler/rustc_hir_analysis/src/check/check.rs:792:29
  31: check_well_formed
             at ./compiler/rustc_hir_analysis/src/check/wfcheck.rs:197:19
  32: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  33: query_ensure_error_guaranteed<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>, ()>
             at ./compiler/rustc_middle/src/query/inner.rs:73:9
  34: check_well_formed<rustc_span::def_id::LocalDefId>
             at ./compiler/rustc_middle/src/query/plumbing.rs:176:9
  35: {closure#0}
             at ./compiler/rustc_hir_analysis/src/check/wfcheck.rs:2309:43
  36: {closure#0}<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure_env#0}>
             at ./compiler/rustc_middle/src/hir/mod.rs:113:58
  37: {closure#0}<&[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:212:55
  38: call_once<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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 /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panic/unwind_safe.rs:274:9
  39: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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}>>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:581:40
  40: catch_unwind<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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 /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:544:19
  41: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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}>>>, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panic.rs:359:14
  42: run<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure#1}::{closure_env#0}<&[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:23:9
  43: {closure#1}<&[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:212:48
  44: {closure#0}<&rustc_hir::hir::ItemId, core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure_env#1}<&[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}>>, fn(core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>) -> core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/iter/adapters/filter_map.rs:39:28
  45: fold<rustc_hir::hir::ItemId, core::result::Result<(), rustc_span::ErrorGuaranteed>, core::iter::adapters::filter_map::filter_map_fold::{closure_env#0}<&rustc_hir::hir::ItemId, core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure_env#1}<&[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}>>, fn(core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>) -> core::result::Result<(), rustc_span::ErrorGuaranteed>>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/slice/iter/macros.rs:279:27
  46: fold<core::result::Result<(), rustc_span::ErrorGuaranteed>, core::slice::iter::Iter<rustc_hir::hir::ItemId>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure#0}::{closure_env#1}<&[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}>>, core::result::Result<(), rustc_span::ErrorGuaranteed>, fn(core::result::Result<(), rustc_span::ErrorGuaranteed>, core::result::Result<(), rustc_span::ErrorGuaranteed>) -> core::result::Result<(), rustc_span::ErrorGuaranteed>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/iter/adapters/filter_map.rs:146:19
  47: {closure#0}<&[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:212:70
  48: parallel_guard<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_data_structures::sync::parallel::try_par_for_each_in::{closure_env#0}<&[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:39:15
  49: try_par_for_each_in<&[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:5
  50: <rustc_middle::hir::ModuleItems>::par_items::<rustc_hir_analysis::check::wfcheck::check_type_wf::{closure#0}>
             at ./compiler/rustc_middle/src/hir/mod.rs:113:9
  51: check_type_wf
             at ./compiler/rustc_hir_analysis/src/check/wfcheck.rs:2309:10
  52: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  53: query_ensure_error_guaranteed<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, ()>
             at ./compiler/rustc_middle/src/query/inner.rs:73:9
  54: check_type_wf
             at ./compiler/rustc_middle/src/query/plumbing.rs:176:9
  55: {closure#0}
             at ./compiler/rustc_hir_analysis/src/lib.rs:183:36
  56: run<(), rustc_hir_analysis::check_crate::{closure_env#0}>
             at ./compiler/rustc_data_structures/src/profiling.rs:844:9
  57: time<(), rustc_hir_analysis::check_crate::{closure_env#0}>
             at ./compiler/rustc_session/src/utils.rs:17:50
  58: check_crate
             at ./compiler/rustc_hir_analysis/src/lib.rs:178:14
  59: run_required_analyses
             at ./compiler/rustc_interface/src/passes.rs:1087:5
  60: analysis
             at ./compiler/rustc_interface/src/passes.rs:1143:5
  61: {closure#0}
             at ./compiler/rustc_query_impl/src/plumbing.rs:282:9
      [... omitted 22 frames ...]
  62: query_ensure<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 0]>>>
             at ./compiler/rustc_middle/src/query/inner.rs:51:9
  63: analysis
             at ./compiler/rustc_middle/src/query/plumbing.rs:173:9
  64: {closure#2}
             at ./compiler/rustc_driver_impl/src/lib.rs:375:29
  65: {closure#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:1019:27
  66: {closure#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context.rs:1643:37
  67: {closure#0}<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:60:9
  68: try_with<core::cell::Cell<*const ()>, 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#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/thread/local.rs:513:12
  69: with<core::cell::Cell<*const ()>, 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#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/thread/local.rs:477:20
  70: enter_context<rustc_middle::ty::context::{impl#20}::enter::{closure_env#1}<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context/tls.rs:57:9
  71: enter<rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, core::option::Option<rustc_interface::queries::Linker>>
             at ./compiler/rustc_middle/src/ty/context.rs:1643:9
  72: create_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_interface::passes::create_and_enter_global_ctxt::{closure#2}::{closure_env#0}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>>
             at ./compiler/rustc_middle/src/ty/context.rs:1850:13
  73: {closure#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:986:9
  74: call_once<rustc_interface::passes::create_and_enter_global_ctxt::{closure_env#2}<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>, (&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &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_env#2})>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/ops/function.rs:250:5
  75: call_once<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &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_env#2}), dyn core::ops::function::FnOnce<(&rustc_session::session::Session, rustc_middle::ty::context::CurrentGcx, alloc::sync::Arc<rustc_data_structures::jobserver::Proxy, alloc::alloc::Global>, &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_env#2}), Output=core::option::Option<rustc_interface::queries::Linker>>, alloc::alloc::Global>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/alloc/src/boxed.rs:2206:9
  76: create_and_enter_global_ctxt<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure_env#2}>
             at ./compiler/rustc_interface/src/passes.rs:1027:5
  77: {closure#0}
             at ./compiler/rustc_driver_impl/src/lib.rs:348:22
  78: {closure#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:532:80
  79: call_once<(), rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/core/src/panic/unwind_safe.rs:274:9
  80: do_call<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:581:40
  81: catch_unwind<(), core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panicking.rs:544:19
  82: catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<rustc_interface::interface::run_compiler::{closure#1}::{closure_env#0}<(), rustc_driver_impl::run_compiler::{closure_env#0}>>, ()>
             at /rustc/9b1f8ff42d110b0ca138116745be921df5dc97e7/library/std/src/panic.rs:359:14
  83: {closure#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>
             at ./compiler/rustc_interface/src/interface.rs:532:23
  84: {closure#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>
             at ./compiler/rustc_interface/src/util.rs:204:17
  85: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at ./compiler/rustc_interface/src/util.rs:158:24
  86: 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::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>, ()>
             at /home/fmease/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/scoped-tls-1.0.1/src/lib.rs:137:9
  87: create_session_globals_then<(), 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_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>>
             at ./compiler/rustc_span/src/lib.rs:143:21
  88: {closure#0}<rustc_interface::util::run_in_thread_pool_with_globals::{closure_env#0}<rustc_interface::interface::run_compiler::{closure_env#1}<(), rustc_driver_impl::run_compiler::{closure_env#0}>, ()>, ()>
             at ./compiler/rustc_interface/src/util.rs:154:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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: rustc 1.95.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -Z unstable-options

query stack during panic:
#0 [explicit_predicates_of] computing explicit predicates of `f`
#1 [predicates_of] computing predicates of `f`
#2 [check_well_formed] checking that `f` is well-formed
#3 [check_type_wf] checking that types are well-formed
#4 [analysis] running analysis passes on crate `t1`
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-higher-rankedArea: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)C-bugCategory: This is a bug.F-trait_alias`#![feature(trait_alias)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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.T-typesRelevant to the types team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions