implement Copy/Clone for generators

This commit is contained in:
Andrew Cann 2022-03-13 13:39:20 +08:00 committed by Charles Lew
parent abd4d2ef0d
commit 2c0bc9444e
3 changed files with 136 additions and 36 deletions

View file

@ -263,7 +263,10 @@ fn resolve_associated_item<'tcx>(
let is_copy = self_ty.is_copy_modulo_regions(tcx.at(DUMMY_SP), param_env);
match self_ty.kind() {
_ if is_copy => (),
ty::Closure(..) | ty::Tuple(..) => {}
ty::Generator(..) |
ty::GeneratorWitness(..) |
ty::Closure(..) |
ty::Tuple(..) => {},
_ => return Ok(None),
};