You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Generalizing a projection containing an inference variable// which cannot be named by the `root_vid` can result in ambiguity.//// Because we do not decrement the universe index when exiting a forall,// this can cause unexpected failures.//// See generalize-proj-new-universe-index-1.rs for more details.// For this reproduction we need:// - an inference variable with a lower universe// - enter a binder to increment the current universe// - create a new inference variable which is constrained by proving a goal// - equate a projection containing the new variable with the first variable// - generalization creates yet another inference variable which is then// part of an alias-relate, resulting this to fail with ambiguity.//// Because we need to enter the binder in-between the creation of the first// and second inference variable, this is easiest via// `assemble_candidates_after_normalizing_self_ty` because eagerly call// `try_evaluate_added_goals` there before creating the inference variables// for the impl parameters.traitId{typeAssoc: ?Sized;}impl<T: ?Sized>IdforT{typeAssoc = T;}// By adding an higher ranked bound to the impl we currently// propagate this bound to the caller, forcing us to create a new// universe.traitIdHigherRankedBound{typeAssoc: ?Sized;}impl<T: ?Sized>IdHigherRankedBoundforTwherefor<'a>T:'a,{typeAssoc = T;}traitWithAssoc<T: ?Sized>{typeAssoc: ?Sized;}structLeaf;structWrapper<U: ?Sized>(U);structRigid;impl<U: ?Sized>WithAssoc<U>forLeaf{typeAssoc = U;}impl<Ur: ?Sized>WithAssoc<Wrapper<Ur>>forRigidwhereLeaf:WithAssoc<Ur>,{typeAssoc = <<LeafasWithAssoc<Ur>>::AssocasId>::Assoc;}fnbound<T: ?Sized,U: ?Sized,V: ?Sized>()whereT:WithAssoc<U,Assoc = V>,{}fnmain(){bound::<<RigidasIdHigherRankedBound>::Assoc, <Wrapper<Leaf>asId>::Assoc,_>()}
The text was updated successfully, but these errors were encountered:
cc rust-lang/rust#114934 for examples.
The text was updated successfully, but these errors were encountered: