Skip to content

Commit 1caf701

Browse files
authored
Rollup merge of #144392 - makai410:rm-mov, r=scottmcm
rustc_public: Remove movability from `RigidTy/AggregateKind::Coroutine` Part of #119174 . I think we should be good now to sync this change in rustc_public.
2 parents acd4a1c + 642deb3 commit 1caf701

File tree

7 files changed

+8
-14
lines changed

7 files changed

+8
-14
lines changed

compiler/rustc_public/src/mir/body.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,7 @@ impl Rvalue {
654654
)),
655655
AggregateKind::Adt(def, _, ref args, _, _) => Ok(def.ty_with_args(args)),
656656
AggregateKind::Closure(def, ref args) => Ok(Ty::new_closure(def, args.clone())),
657-
AggregateKind::Coroutine(def, ref args, mov) => {
658-
Ok(Ty::new_coroutine(def, args.clone(), mov))
659-
}
657+
AggregateKind::Coroutine(def, ref args) => Ok(Ty::new_coroutine(def, args.clone())),
660658
AggregateKind::CoroutineClosure(def, ref args) => {
661659
Ok(Ty::new_coroutine_closure(def, args.clone()))
662660
}
@@ -674,8 +672,7 @@ pub enum AggregateKind {
674672
Tuple,
675673
Adt(AdtDef, VariantIdx, GenericArgs, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
676674
Closure(ClosureDef, GenericArgs),
677-
// FIXME(rustc_public): Movability here is redundant
678-
Coroutine(CoroutineDef, GenericArgs, Movability),
675+
Coroutine(CoroutineDef, GenericArgs),
679676
CoroutineClosure(CoroutineClosureDef, GenericArgs),
680677
RawPtr(Ty, Mutability),
681678
}

compiler/rustc_public/src/mir/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ fn pretty_aggregate<W: Write>(
428428
write!(writer, "{{closure@{}}}(", def.span().diagnostic())?;
429429
")"
430430
}
431-
AggregateKind::Coroutine(def, _, _) => {
431+
AggregateKind::Coroutine(def, _) => {
432432
write!(writer, "{{coroutine@{}}}(", def.span().diagnostic())?;
433433
")"
434434
}

compiler/rustc_public/src/ty.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ impl Ty {
6060
}
6161

6262
/// Create a new coroutine type.
63-
pub fn new_coroutine(def: CoroutineDef, args: GenericArgs, mov: Movability) -> Ty {
64-
Ty::from_rigid_kind(RigidTy::Coroutine(def, args, mov))
63+
pub fn new_coroutine(def: CoroutineDef, args: GenericArgs) -> Ty {
64+
Ty::from_rigid_kind(RigidTy::Coroutine(def, args))
6565
}
6666

6767
/// Create a new closure type.
@@ -560,8 +560,7 @@ pub enum RigidTy {
560560
FnDef(FnDef, GenericArgs),
561561
FnPtr(PolyFnSig),
562562
Closure(ClosureDef, GenericArgs),
563-
// FIXME(rustc_public): Movability here is redundant
564-
Coroutine(CoroutineDef, GenericArgs, Movability),
563+
Coroutine(CoroutineDef, GenericArgs),
565564
CoroutineClosure(CoroutineClosureDef, GenericArgs),
566565
Dynamic(Vec<Binder<ExistentialPredicate>>, Region, DynKind),
567566
Never,

compiler/rustc_public/src/unstable/convert/internal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl RustcInternal for RigidTy {
177177
RigidTy::Closure(def, args) => {
178178
rustc_ty::TyKind::Closure(def.0.internal(tables, tcx), args.internal(tables, tcx))
179179
}
180-
RigidTy::Coroutine(def, args, _mov) => {
180+
RigidTy::Coroutine(def, args) => {
181181
rustc_ty::TyKind::Coroutine(def.0.internal(tables, tcx), args.internal(tables, tcx))
182182
}
183183
RigidTy::CoroutineClosure(def, args) => rustc_ty::TyKind::CoroutineClosure(

compiler/rustc_public/src/unstable/convert/stable/mir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,6 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> {
653653
crate::mir::AggregateKind::Coroutine(
654654
tables.coroutine_def(*def_id),
655655
generic_arg.stable(tables, cx),
656-
cx.coroutine_movability(*def_id).stable(tables, cx),
657656
)
658657
}
659658
mir::AggregateKind::CoroutineClosure(def_id, generic_args) => {

compiler/rustc_public/src/unstable/convert/stable/ty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
457457
ty::Coroutine(def_id, generic_args) => TyKind::RigidTy(RigidTy::Coroutine(
458458
tables.coroutine_def(*def_id),
459459
generic_args.stable(tables, cx),
460-
cx.coroutine_movability(*def_id).stable(tables, cx),
461460
)),
462461
ty::Never => TyKind::RigidTy(RigidTy::Never),
463462
ty::Tuple(fields) => TyKind::RigidTy(RigidTy::Tuple(

compiler/rustc_public/src/visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl Visitable for RigidTy {
166166
}
167167
RigidTy::Adt(_, args)
168168
| RigidTy::Closure(_, args)
169-
| RigidTy::Coroutine(_, args, _)
169+
| RigidTy::Coroutine(_, args)
170170
| RigidTy::CoroutineWitness(_, args)
171171
| RigidTy::CoroutineClosure(_, args)
172172
| RigidTy::FnDef(_, args) => args.visit(visitor),

0 commit comments

Comments
 (0)