diff options
| author | Michael Goulet <michael@errs.io> | 2023-12-21 01:52:10 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-12-28 16:35:01 +0000 |
| commit | fcb42b42d6fc078b15a34ed27b969fe2ba290989 (patch) | |
| tree | 721b8cba2b52e44646eb55e7a6748dfee00d9a49 /compiler/rustc_middle/src/ty/sty.rs | |
| parent | f4d794ea0b845413344621d89f6c945062748485 (diff) | |
| download | rust-fcb42b42d6fc078b15a34ed27b969fe2ba290989.tar.gz rust-fcb42b42d6fc078b15a34ed27b969fe2ba290989.zip | |
Remove movability from TyKind::Coroutine
Diffstat (limited to 'compiler/rustc_middle/src/ty/sty.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index 5b9dff8e3f2..cf5957ab205 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -2168,14 +2168,13 @@ impl<'tcx> Ty<'tcx> { tcx: TyCtxt<'tcx>, def_id: DefId, coroutine_args: GenericArgsRef<'tcx>, - movability: hir::Movability, ) -> Ty<'tcx> { debug_assert_eq!( coroutine_args.len(), tcx.generics_of(tcx.typeck_root_def_id(def_id)).count() + 5, "coroutine constructed with incorrect number of substitutions" ); - Ty::new(tcx, Coroutine(def_id, coroutine_args, movability)) + Ty::new(tcx, Coroutine(def_id, coroutine_args)) } #[inline] @@ -2656,7 +2655,7 @@ impl<'tcx> Ty<'tcx> { pub fn variant_range(self, tcx: TyCtxt<'tcx>) -> Option<Range<VariantIdx>> { match self.kind() { TyKind::Adt(adt, _) => Some(adt.variant_range()), - TyKind::Coroutine(def_id, args, _) => { + TyKind::Coroutine(def_id, args) => { Some(args.as_coroutine().variant_range(*def_id, tcx)) } _ => None, @@ -2677,7 +2676,7 @@ impl<'tcx> Ty<'tcx> { TyKind::Adt(adt, _) if adt.is_enum() => { Some(adt.discriminant_for_variant(tcx, variant_index)) } - TyKind::Coroutine(def_id, args, _) => { + TyKind::Coroutine(def_id, args) => { Some(args.as_coroutine().discriminant_for_variant(*def_id, tcx, variant_index)) } _ => None, @@ -2688,7 +2687,7 @@ impl<'tcx> Ty<'tcx> { pub fn discriminant_ty(self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> { match self.kind() { ty::Adt(adt, _) if adt.is_enum() => adt.repr().discr_type().to_ty(tcx), - ty::Coroutine(_, args, _) => args.as_coroutine().discr_ty(tcx), + ty::Coroutine(_, args) => args.as_coroutine().discr_ty(tcx), ty::Param(_) | ty::Alias(..) | ty::Infer(ty::TyVar(_)) => { let assoc_items = tcx.associated_item_def_ids( @@ -2983,7 +2982,7 @@ impl<'tcx> Ty<'tcx> { | FnPtr(_) | Dynamic(_, _, _) | Closure(_, _) - | Coroutine(_, _, _) + | Coroutine(_, _) | CoroutineWitness(..) | Never | Tuple(_) => true, |
