mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
Avoid an ICE in the presence of HKL
This commit is contained in:
parent
ebf2772c58
commit
7a1ccf9a03
@ -66,6 +66,10 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
||||
|
||||
let mut subst_regions = vec![self.universal_regions.fr_static];
|
||||
let universal_substs = infcx.tcx.fold_regions(substs, &mut false, |region, _| {
|
||||
if let ty::RePlaceholder(..) = region {
|
||||
// Higher kinded regions don't need remapping, they don't refer to anything outside of this the substs.
|
||||
return region;
|
||||
}
|
||||
let vid = self.to_region_vid(region);
|
||||
trace!(?vid);
|
||||
let scc = self.constraint_sccs.scc(vid);
|
||||
|
15
src/test/ui/impl-trait/issues/issue-88236.rs
Normal file
15
src/test/ui/impl-trait/issues/issue-88236.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// check-pass
|
||||
|
||||
// this used to cause stack overflows
|
||||
|
||||
trait Hrtb<'a> {
|
||||
type Assoc;
|
||||
}
|
||||
|
||||
impl<'a> Hrtb<'a> for () {
|
||||
type Assoc = ();
|
||||
}
|
||||
|
||||
fn make_impl() -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user