loosen restriction on when GeneratorWitness: Clone
This commit is contained in:
parent
0228c073e0
commit
a5cb3cca5e
1 changed files with 13 additions and 17 deletions
|
@ -1958,23 +1958,19 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
ty::GeneratorWitness(binder) => {
|
ty::GeneratorWitness(binder) => {
|
||||||
match binder.no_bound_vars() {
|
let tys = self.tcx().erase_late_bound_regions(binder);
|
||||||
Some(tys) => {
|
let mut iter = tys.iter();
|
||||||
let mut iter = tys.iter();
|
loop {
|
||||||
loop {
|
let ty = match iter.next() {
|
||||||
let ty = match iter.next() {
|
Some(ty) => ty,
|
||||||
Some(ty) => ty,
|
Option::None => {
|
||||||
Option::None => {
|
break Where(obligation.predicate.rebind(tys.to_vec()))
|
||||||
break Where(obligation.predicate.rebind(tys.to_vec()))
|
},
|
||||||
},
|
};
|
||||||
};
|
let resolved = self.infcx.shallow_resolve(ty);
|
||||||
let resolved = self.infcx.shallow_resolve(ty);
|
if matches!(resolved.kind(), ty::Infer(ty::TyVar(_))) {
|
||||||
if matches!(resolved.kind(), ty::Infer(ty::TyVar(_))) {
|
break Ambiguous;
|
||||||
break Ambiguous;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Option::None => None,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue