diff options
| author | Folkert de Vries <flokkievids@gmail.com> | 2025-08-03 10:44:41 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-03 10:44:41 +0000 |
| commit | c691374cc19d583103f3da5d655efb308a1648b9 (patch) | |
| tree | 767496caef5b54e56f46a834d0d612705ce5e488 /compiler/rustc_public/src | |
| parent | daa742afe5970109c1e15b391226f78087b10439 (diff) | |
| parent | 49aa0ecc7b251003e61c38a56471195a2d3dabee (diff) | |
| download | rust-c691374cc19d583103f3da5d655efb308a1648b9.tar.gz rust-c691374cc19d583103f3da5d655efb308a1648b9.zip | |
Merge pull request #1889 from rust-lang/rustc-pull
Rustc pull update
Diffstat (limited to 'compiler/rustc_public/src')
| -rw-r--r-- | compiler/rustc_public/src/alloc.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/body.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_public/src/mir/pretty.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/ty.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_public/src/unstable/convert/internal.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_public/src/unstable/convert/stable/mir.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_public/src/unstable/convert/stable/ty.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_public/src/visitor.rs | 2 |
8 files changed, 12 insertions, 18 deletions
diff --git a/compiler/rustc_public/src/alloc.rs b/compiler/rustc_public/src/alloc.rs index 75ad31022ff..0c35b3b25df 100644 --- a/compiler/rustc_public/src/alloc.rs +++ b/compiler/rustc_public/src/alloc.rs @@ -33,7 +33,7 @@ fn new_empty_allocation(align: Align) -> Allocation { #[allow(rustc::usage_of_qualified_ty)] pub(crate) fn new_allocation<'tcx>( ty: rustc_middle::ty::Ty<'tcx>, - const_value: ConstValue<'tcx>, + const_value: ConstValue, tables: &mut Tables<'tcx, BridgeTys>, cx: &CompilerCtxt<'tcx, BridgeTys>, ) -> Allocation { @@ -44,7 +44,7 @@ pub(crate) fn new_allocation<'tcx>( #[allow(rustc::usage_of_qualified_ty)] pub(crate) fn try_new_allocation<'tcx>( ty: rustc_middle::ty::Ty<'tcx>, - const_value: ConstValue<'tcx>, + const_value: ConstValue, tables: &mut Tables<'tcx, BridgeTys>, cx: &CompilerCtxt<'tcx, BridgeTys>, ) -> Result<Allocation, Error> { @@ -54,8 +54,8 @@ pub(crate) fn try_new_allocation<'tcx>( alloc::try_new_scalar(layout, scalar, cx).map(|alloc| alloc.stable(tables, cx)) } ConstValue::ZeroSized => Ok(new_empty_allocation(layout.align.abi)), - ConstValue::Slice { data, meta } => { - alloc::try_new_slice(layout, data, meta, cx).map(|alloc| alloc.stable(tables, cx)) + ConstValue::Slice { alloc_id, meta } => { + alloc::try_new_slice(layout, alloc_id, meta, cx).map(|alloc| alloc.stable(tables, cx)) } ConstValue::Indirect { alloc_id, offset } => { let alloc = alloc::try_new_indirect(alloc_id, cx); diff --git a/compiler/rustc_public/src/mir/body.rs b/compiler/rustc_public/src/mir/body.rs index 3320b98cd61..3d595286041 100644 --- a/compiler/rustc_public/src/mir/body.rs +++ b/compiler/rustc_public/src/mir/body.rs @@ -654,9 +654,7 @@ impl Rvalue { )), AggregateKind::Adt(def, _, ref args, _, _) => Ok(def.ty_with_args(args)), AggregateKind::Closure(def, ref args) => Ok(Ty::new_closure(def, args.clone())), - AggregateKind::Coroutine(def, ref args, mov) => { - Ok(Ty::new_coroutine(def, args.clone(), mov)) - } + AggregateKind::Coroutine(def, ref args) => Ok(Ty::new_coroutine(def, args.clone())), AggregateKind::CoroutineClosure(def, ref args) => { Ok(Ty::new_coroutine_closure(def, args.clone())) } @@ -674,8 +672,7 @@ pub enum AggregateKind { Tuple, Adt(AdtDef, VariantIdx, GenericArgs, Option<UserTypeAnnotationIndex>, Option<FieldIdx>), Closure(ClosureDef, GenericArgs), - // FIXME(rustc_public): Movability here is redundant - Coroutine(CoroutineDef, GenericArgs, Movability), + Coroutine(CoroutineDef, GenericArgs), CoroutineClosure(CoroutineClosureDef, GenericArgs), RawPtr(Ty, Mutability), } diff --git a/compiler/rustc_public/src/mir/pretty.rs b/compiler/rustc_public/src/mir/pretty.rs index a433df2dba1..3183c020772 100644 --- a/compiler/rustc_public/src/mir/pretty.rs +++ b/compiler/rustc_public/src/mir/pretty.rs @@ -428,7 +428,7 @@ fn pretty_aggregate<W: Write>( write!(writer, "{{closure@{}}}(", def.span().diagnostic())?; ")" } - AggregateKind::Coroutine(def, _, _) => { + AggregateKind::Coroutine(def, _) => { write!(writer, "{{coroutine@{}}}(", def.span().diagnostic())?; ")" } diff --git a/compiler/rustc_public/src/ty.rs b/compiler/rustc_public/src/ty.rs index bc67a2f987d..de4b21b1764 100644 --- a/compiler/rustc_public/src/ty.rs +++ b/compiler/rustc_public/src/ty.rs @@ -60,8 +60,8 @@ impl Ty { } /// Create a new coroutine type. - pub fn new_coroutine(def: CoroutineDef, args: GenericArgs, mov: Movability) -> Ty { - Ty::from_rigid_kind(RigidTy::Coroutine(def, args, mov)) + pub fn new_coroutine(def: CoroutineDef, args: GenericArgs) -> Ty { + Ty::from_rigid_kind(RigidTy::Coroutine(def, args)) } /// Create a new closure type. @@ -560,8 +560,7 @@ pub enum RigidTy { FnDef(FnDef, GenericArgs), FnPtr(PolyFnSig), Closure(ClosureDef, GenericArgs), - // FIXME(rustc_public): Movability here is redundant - Coroutine(CoroutineDef, GenericArgs, Movability), + Coroutine(CoroutineDef, GenericArgs), CoroutineClosure(CoroutineClosureDef, GenericArgs), Dynamic(Vec<Binder<ExistentialPredicate>>, Region, DynKind), Never, diff --git a/compiler/rustc_public/src/unstable/convert/internal.rs b/compiler/rustc_public/src/unstable/convert/internal.rs index b2d38e497bc..66f767a98f5 100644 --- a/compiler/rustc_public/src/unstable/convert/internal.rs +++ b/compiler/rustc_public/src/unstable/convert/internal.rs @@ -177,7 +177,7 @@ impl RustcInternal for RigidTy { RigidTy::Closure(def, args) => { rustc_ty::TyKind::Closure(def.0.internal(tables, tcx), args.internal(tables, tcx)) } - RigidTy::Coroutine(def, args, _mov) => { + RigidTy::Coroutine(def, args) => { rustc_ty::TyKind::Coroutine(def.0.internal(tables, tcx), args.internal(tables, tcx)) } RigidTy::CoroutineClosure(def, args) => rustc_ty::TyKind::CoroutineClosure( diff --git a/compiler/rustc_public/src/unstable/convert/stable/mir.rs b/compiler/rustc_public/src/unstable/convert/stable/mir.rs index 8dee579e598..be8ee80bed3 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/mir.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/mir.rs @@ -653,7 +653,6 @@ impl<'tcx> Stable<'tcx> for mir::AggregateKind<'tcx> { crate::mir::AggregateKind::Coroutine( tables.coroutine_def(*def_id), generic_arg.stable(tables, cx), - cx.coroutine_movability(*def_id).stable(tables, cx), ) } mir::AggregateKind::CoroutineClosure(def_id, generic_args) => { diff --git a/compiler/rustc_public/src/unstable/convert/stable/ty.rs b/compiler/rustc_public/src/unstable/convert/stable/ty.rs index d679615b3bd..5a661072bc7 100644 --- a/compiler/rustc_public/src/unstable/convert/stable/ty.rs +++ b/compiler/rustc_public/src/unstable/convert/stable/ty.rs @@ -457,7 +457,6 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> { ty::Coroutine(def_id, generic_args) => TyKind::RigidTy(RigidTy::Coroutine( tables.coroutine_def(*def_id), generic_args.stable(tables, cx), - cx.coroutine_movability(*def_id).stable(tables, cx), )), ty::Never => TyKind::RigidTy(RigidTy::Never), ty::Tuple(fields) => TyKind::RigidTy(RigidTy::Tuple( diff --git a/compiler/rustc_public/src/visitor.rs b/compiler/rustc_public/src/visitor.rs index 45e2a815470..87f1cc6ae69 100644 --- a/compiler/rustc_public/src/visitor.rs +++ b/compiler/rustc_public/src/visitor.rs @@ -166,7 +166,7 @@ impl Visitable for RigidTy { } RigidTy::Adt(_, args) | RigidTy::Closure(_, args) - | RigidTy::Coroutine(_, args, _) + | RigidTy::Coroutine(_, args) | RigidTy::CoroutineWitness(_, args) | RigidTy::CoroutineClosure(_, args) | RigidTy::FnDef(_, args) => args.visit(visitor), |
