1
Fork 0

loosen restriction on when GeneratorWitness: Clone

This commit is contained in:
Andrew Cann 2022-03-14 10:24:10 +08:00 committed by Charles Lew
parent 0228c073e0
commit a5cb3cca5e

View file

@ -1958,8 +1958,7 @@ 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() {
@ -1973,9 +1972,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
break Ambiguous; break Ambiguous;
} }
} }
},
Option::None => None,
}
} }
ty::Closure(_, substs) => { ty::Closure(_, substs) => {