Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions compiler/rustc_hir_typeck/src/writeback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1003,8 +1003,10 @@ impl<'cx, 'tcx> TypeFolder<TyCtxt<'tcx>> for Resolver<'cx, 'tcx> {
}

fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
debug_assert!(!r.is_bound(), "Should not be resolving bound region.");
self.fcx.tcx.lifetimes.re_erased
match r.kind() {
ty::ReBound(..) => r,
_ => self.fcx.tcx.lifetimes.re_erased,
}
}

fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ where
} else if let Err(guar) = infcx.tcx.check_potentially_region_dependent_goals(root_def_id) {
Err(guar)
} else {
Err(infcx
.dcx()
.delayed_bug(format!("errors selecting obligation during MIR typeck: {errors:?}")))
Err(infcx.dcx().delayed_bug(format!(
"errors selecting obligation during MIR typeck: {name} {root_def_id:?} {errors:?}"
)))
}
})?;

Expand Down
27 changes: 0 additions & 27 deletions tests/crashes/117808.rs

This file was deleted.

14 changes: 14 additions & 0 deletions tests/ui/traits/next-solver/writeback-predicate-bound-region.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ edition: 2024
//@ check-pass
//@ compile-flags: -Znext-solver

// This previously ICE'd during writeback when resolving
// the stalled coroutine predicate due to its bound lifetime.

trait Trait<'a> {}
impl<'a, T: Send> Trait<'a> for T {}

fn is_trait<T: for<'a> Trait<'a>>(_: T) {}
fn main() {
is_trait(async {})
}
Loading