Avoid cycle in nested obligations for object candidate
Bounds of the form `type Future: Future<Result=Self::Result>` exist in some ecosystem crates. To validate these bounds for trait objects we need to normalize `Self::Result` in a way that doesn't cause a cycle.
This commit is contained in:
parent
582ccec1c5
commit
f52b2d8890
12 changed files with 382 additions and 52 deletions
|
@ -1513,6 +1513,7 @@ impl<'tcx> ExistentialProjection<'tcx> {
|
|||
/// then this function would return a `exists T. T: Iterator` existential trait
|
||||
/// reference.
|
||||
pub fn trait_ref(&self, tcx: TyCtxt<'_>) -> ty::ExistentialTraitRef<'tcx> {
|
||||
// FIXME(generic_associated_types): truncate substs to have the right length.
|
||||
let def_id = tcx.associated_item(self.item_def_id).container.id();
|
||||
ty::ExistentialTraitRef { def_id, substs: self.substs }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue