[ICE]: `entered unreachable code: we only replace regions in nll_relate, not types`
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
The panic is raised at the unreachable branch in compiler/rustc_borrowck/src/type_check/relate_tys.rs around line 220, inside NllTypeRelating::enter_forall, reached while borrow-checking f from the reproducer with a higher-ranked trait alias behind &dyn. Start by reading that function and the binders path that calls it, then reproduce with the minimized snippet under the non_lifetime_binders feature. Done means the ICE no longer occurs and the case has a UI test under tests/ui/traits/alias/.
索引モデルが issue の本文から書いたものです。
説明
Code
#![feature(non_lifetime_binders)]
#![feature(trait_alias)]
#![expect(incomplete_features)]
trait Test<T> {}
pub trait SelfInput = for<T> Test<T>;
pub fn f(_f: &dyn SelfInput) {}
fn main() {}
A mutant of tests/ui/traits/alias/self-in-generics.rs.
Meta
rustc --version --verbose:
rustc 1.102.0-nightly (20fe935d5 2026-11-23)
binary: rustc
commit-hash: 20fe935d50367c0ff8872c2ebfa050c5c99d9201
commit-date: 2026-11-23
host: x86_64-unknown-linux-gnu
release: 1.102.0-nightly
LLVM version: 23.1.6
Error output
Command: rustc --edition 2024
thread 'rustc' (282225) panicked at /rustc-dev/20fe935d50367c0ff8872c2ebfa050c5c99d9201/compiler/rustc_borrowck/src/type_check/relate_tys.rs:220:21:
internal error: entered unreachable code: we only replace regions in nll_relate, not types
Backtrace
thread 'rustc' (282225) panicked at /rustc-dev/20fe935d50367c0ff8872c2ebfa050c5c99d9201/compiler/rustc_borrowck/src/type_check/relate_tys.rs:220:21:
internal error: entered unreachable code: we only replace regions in nll_relate, not types
stack backtrace:
0: __rustc::rust_begin_unwind
1: core::panicking::panic_fmt
2: <<rustc_borrowck::type_check::relate_tys::NllTypeRelating>::enter_forall<rustc_type_ir::ty_kind::FnSig<rustc_middle::ty::context::TyCtxt>, core::result::Result<rustc_type_ir::ty_kind::FnSig<rustc_middle::ty::context::TyCtxt>, rustc_type_ir::error::TypeError<rustc_middle::ty::context::TyCtxt>>, <rustc_borrowck::type_check::relate_tys::NllTypeRelating as rustc_type_ir::relate::TypeRelation<rustc_middle::ty::context::TyCtxt>>::binders<rustc_type_ir::ty_kind::FnSig<rustc_middle::ty::context::TyCtxt>>::{closure#0}>::{closure#1} as core::ops::function::FnOnce<(rustc_type_ir::binder::BoundTy<rustc_middle::ty::context::TyCtxt>,)>>::call_once::{shim:vtable#0}
3: <rustc_type_ir::fold::BoundVarReplacer<rustc_middle::ty::context::TyCtxt, rustc_type_ir::fold::FnMutDelegate<rustc_middle::ty::context::TyCtxt>> as rustc_type_ir::fold::TypeFolder<rustc_middle::ty::context::TyCtxt>>::fold_ty
4: <rustc_middle::ty::generic_args::GenericArgs as rustc_type_ir::fold::TypeFoldable<rustc_middle::ty::context::TyCtxt>>::fold_with::<rustc_type_ir::fold::BoundVarReplacer<rustc_middle::ty::context::TyCtxt, rustc_type_ir::fold::FnMutDelegate<rustc_middle::ty::context::TyCtxt>>>
5: rustc_type_ir::fold::replace_escaping_bound_vars_uncached::<rustc_middle::ty::context::TyCtxt, rustc_type_ir::predicate::ExistentialTraitRef<rustc_middle::ty::context::TyCtxt>, rustc_type_ir::fold::FnMutDelegate<rustc_middle::ty::context::TyCtxt>>
6: <&rustc_middle::ty::list::RawList<(), rustc_type_ir::binder::Binder<rustc_middle::ty::context::TyCtxt, rustc_type_ir::predicate::ExistentialPredicate<rustc_middle::ty::context::TyCtxt>>> as rustc_type_ir::relate::Relate<rustc_middle::ty::context::TyCtxt>>::relate::<rustc_borrowck::type_check::relate_tys::NllTypeRelating>::{closure#0}
7: <&rustc_middle::ty::list::RawList<(), rustc_type_ir::binder::Binder<rustc_middle::ty::context::TyCtxt, rustc_type_ir::predicate::ExistentialPredicate<rustc_middle::ty::context::TyCtxt>>> as rustc_type_ir::relate::Relate<rustc_middle::ty::context::TyCtxt>>::relate::<rustc_borrowck::type_check::relate_tys::NllTypeRelating>
8: rustc_type_ir::relate::structurally_relate_tys::<rustc_middle::ty::context::TyCtxt, rustc_borrowck::type_check::relate_tys::NllTypeRelating>::{closure#0}
9: rustc_type_ir::relate::structurally_relate_tys::<rustc_middle::ty::context::TyCtxt, rustc_borrowck::type_check::relate_tys::NllTypeRelating>::{closure#0}
10: rustc_borrowck::borrowck_collect_region_constraints
11: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::do_mir_borrowck
12: rustc_borrowck::mir_borrowck
[... omitted 1 frame ...]
13: <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners::<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}
14: rustc_thread_pool::scope::scope::<rustc_data_structures::sync::parallel::par_range_internal<rustc_data_structures::sync::parallel::par_for_each_in<rustc_span::def_id::LocalDefId, [rustc_span::def_id::LocalDefId], <rustc_middle::ty::context::TyCtxt>::par_hir_body_owners<rustc_interface::passes::run_required_analyses::{closure#2}::{closure#0}>::{closure#0}>::{closure#0}::{closure#0}>::{closure#1}, ()>::{closure#0}
15: rustc_interface::passes::run_required_analyses
16: rustc_query_impl::execution::try_execute_query::<rustc_middle::query::caches::SingleCache<rustc_middle::query::erase::ErasedData<[u8; 0]>>, false>
17: rustc_interface::passes::full_analysis
18: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::compiler_entrypoint::{closure#0}>::{closure#2}
19: <rustc_thread_pool::job::StackJob<rustc_thread_pool::latch::LatchRef<rustc_thread_pool::latch::LockLatch>, <rustc_thread_pool::registry::Registry>::in_worker_cold<<rustc_thread_pool::thread_pool::ThreadPool>::install<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<(), rustc_driver_impl::compiler_entrypoint::{closure#0}>::{closure#2}, ()>::{closure#6}::{closure#0}::{closure#1}::{closure#0}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()> as rustc_thread_pool::job::Job>::execute
20: <rustc_thread_pool::registry::WorkerThread>::wait_or_steal_until_cold
21: <rustc_thread_pool::registry::ThreadBuilder>::run
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: please attach the file at `/home/jb/workspace/261124-ice-report-check/tmp/rustc-ice-2026-11-24T04_32_38-282214.txt` to your bug report
note: rustc 1.102.0-nightly (20fe935d5 2026-11-23) running on x86_64-unknown-linux-gnu
query stack during panic:
#0 [mir_borrowck] borrow-checking `f`
#1 [required_analysis] running required analysis passes on crate `asdf`
end of query stack
Notes
- ICE location:
rustc_borrowck/src/type_check/relate_tys.rsLine-220
https://github.com/rust-lang/rust/blob/20fe935d50367c0ff8872c2ebfa050c5c99d9201/compiler/rustc_borrowck/src/type_check/relate_tys.rs#L212-L224
Duplication Check
- I found none with
we only replace regions in nll_relateICE message. github search results
@rustbot label +S-found-by-fuzzing +F-non_lifetime_binders +F-trait_alias
- 主要言語
- Rust
- スター
- 123k
- フォーク
- 16.6k
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 532
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-lang/rust のほかの issue
-
C-bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
rust-lang/rust#166722 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
A-attributes relnotes relnotes-needs-review relnotes-tracking-issue T-compiler T-lang
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
A-run-make C-bug T-bootstrap
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
Tracking issue for release notes of #161531: Remove `T: Send + Sync` bound from `Arc::downcast`オープンrelnotes relnotes-tracking-issue T-libs
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
A-str A-Unicode relnotes relnotes-tracking-issue T-libs
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug core-lang
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Windows microphone listing treats words in a device name as DirectShow labels対応中かも @Sujal-chaudhary が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
clipy-recorder/clipy#447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
nightly-cleanup
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
max-sixty/worktrunk#4939 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信