Remove movability from TyKind::Coroutine
This commit is contained in:
parent
f4d794ea0b
commit
fcb42b42d6
84 changed files with 212 additions and 220 deletions
|
@ -69,7 +69,7 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
|
|||
ty::InstanceDef::DropGlue(def_id, ty) => {
|
||||
// FIXME(#91576): Drop shims for coroutines aren't subject to the MIR passes at the end
|
||||
// of this function. Is this intentional?
|
||||
if let Some(ty::Coroutine(coroutine_def_id, args, _)) = ty.map(Ty::kind) {
|
||||
if let Some(ty::Coroutine(coroutine_def_id, args)) = ty.map(Ty::kind) {
|
||||
let body = tcx.optimized_mir(*coroutine_def_id).coroutine_drop().unwrap();
|
||||
let mut body = EarlyBinder::bind(body.clone()).instantiate(tcx, args);
|
||||
debug!("make_shim({:?}) = {:?}", instance, body);
|
||||
|
@ -394,7 +394,8 @@ fn build_clone_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'tcx>) -
|
|||
_ if is_copy => builder.copy_shim(),
|
||||
ty::Closure(_, args) => builder.tuple_like_shim(dest, src, args.as_closure().upvar_tys()),
|
||||
ty::Tuple(..) => builder.tuple_like_shim(dest, src, self_ty.tuple_fields()),
|
||||
ty::Coroutine(coroutine_def_id, args, hir::Movability::Movable) => {
|
||||
ty::Coroutine(coroutine_def_id, args) => {
|
||||
assert_eq!(tcx.movability(coroutine_def_id), hir::Movability::Movable);
|
||||
builder.coroutine_shim(dest, src, *coroutine_def_id, args.as_coroutine())
|
||||
}
|
||||
_ => bug!("clone shim for `{:?}` which is not `Copy` and is not an aggregate", self_ty),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue