Skip to content

Commit 8cb3c29

Browse files
committed
Merge ref 'fb24b04b096a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: fb24b04b096a980bffd80154f6aba22fd07cb3d9 Filtered ref: 8d328b994c70dfeed12717a13a915703ec939cfc Upstream diff: rust-lang/rust@3369e82...fb24b04 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 080eb98 + 7804e1e commit 8cb3c29

File tree

6 files changed

+8
-23
lines changed

6 files changed

+8
-23
lines changed

rustc_public/src/mir/body.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ pub enum StatementKind {
478478
Assign(Place, Rvalue),
479479
FakeRead(FakeReadCause, Place),
480480
SetDiscriminant { place: Place, variant_index: VariantIdx },
481-
Deinit(Place),
482481
StorageLive(Local),
483482
StorageDead(Local),
484483
Retag(RetagKind, Place),
@@ -836,14 +835,6 @@ pub enum ProjectionElem {
836835
/// Like an explicit cast from an opaque type to a concrete type, but without
837836
/// requiring an intermediate variable.
838837
OpaqueCast(Ty),
839-
840-
/// A `Subtype(T)` projection is applied to any `StatementKind::Assign` where
841-
/// type of lvalue doesn't match the type of rvalue, the primary goal is making subtyping
842-
/// explicit during optimizations and codegen.
843-
///
844-
/// This projection doesn't impact the runtime behavior of the program except for potentially changing
845-
/// some type metadata of the interpreter or codegen backend.
846-
Subtype(Ty),
847838
}
848839

849840
#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
@@ -1028,6 +1019,7 @@ pub enum CastKind {
10281019
PtrToPtr,
10291020
FnPtrToPtr,
10301021
Transmute,
1022+
Subtype,
10311023
}
10321024

10331025
#[derive(Clone, Debug, Eq, PartialEq, Hash, Serialize)]
@@ -1089,7 +1081,7 @@ impl ProjectionElem {
10891081
Self::subslice_ty(ty, *from, *to, *from_end)
10901082
}
10911083
ProjectionElem::Downcast(_) => Ok(ty),
1092-
ProjectionElem::OpaqueCast(ty) | ProjectionElem::Subtype(ty) => Ok(*ty),
1084+
ProjectionElem::OpaqueCast(ty) => Ok(*ty),
10931085
}
10941086
}
10951087

rustc_public/src/mir/pretty.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ fn pretty_statement<W: Write>(writer: &mut W, statement: &StatementKind) -> io::
102102
StatementKind::SetDiscriminant { place, variant_index } => {
103103
writeln!(writer, "{INDENT}discriminant({place:?}) = {};", variant_index.to_index())
104104
}
105-
StatementKind::Deinit(place) => writeln!(writer, "Deinit({place:?};"),
106105
StatementKind::StorageLive(local) => {
107106
writeln!(writer, "{INDENT}StorageLive(_{local});")
108107
}

rustc_public/src/mir/visit.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ macro_rules! make_mir_visitor {
170170
self.visit_place(place, PlaceContext::NON_MUTATING, location);
171171
}
172172
StatementKind::SetDiscriminant { place, .. }
173-
| StatementKind::Deinit(place)
174173
| StatementKind::Retag(_, place) => {
175174
self.visit_place(place, PlaceContext::MUTATING, location);
176175
}
@@ -471,7 +470,6 @@ macro_rules! visit_place_fns {
471470
ProjectionElem::Subslice { from: _, to: _, from_end: _ } => {}
472471
ProjectionElem::Downcast(_idx) => {}
473472
ProjectionElem::OpaqueCast(ty) => self.visit_ty(ty, location),
474-
ProjectionElem::Subtype(ty) => self.visit_ty(ty, location),
475473
}
476474
}
477475
};
@@ -512,7 +510,6 @@ macro_rules! visit_place_fns {
512510
ProjectionElem::Subslice { from: _, to: _, from_end: _ } => {}
513511
ProjectionElem::Downcast(_idx) => {}
514512
ProjectionElem::OpaqueCast(ty) => self.visit_ty(ty, location),
515-
ProjectionElem::Subtype(ty) => self.visit_ty(ty, location),
516513
}
517514
}
518515
};

rustc_public/src/unstable/convert/internal.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,6 @@ impl RustcInternal for ProjectionElem {
703703
ProjectionElem::OpaqueCast(ty) => {
704704
rustc_middle::mir::PlaceElem::OpaqueCast(ty.internal(tables, tcx))
705705
}
706-
ProjectionElem::Subtype(ty) => {
707-
rustc_middle::mir::PlaceElem::Subtype(ty.internal(tables, tcx))
708-
}
709706
}
710707
}
711708
}

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,6 @@ impl<'tcx> Stable<'tcx> for mir::StatementKind<'tcx> {
149149
variant_index: variant_index.stable(tables, cx),
150150
}
151151
}
152-
mir::StatementKind::Deinit(place) => {
153-
crate::mir::StatementKind::Deinit(place.stable(tables, cx))
154-
}
155152

156153
mir::StatementKind::StorageLive(place) => {
157154
crate::mir::StatementKind::StorageLive(place.stable(tables, cx))
@@ -356,6 +353,7 @@ impl<'tcx> Stable<'tcx> for mir::CastKind {
356353
PtrToPtr => crate::mir::CastKind::PtrToPtr,
357354
FnPtrToPtr => crate::mir::CastKind::FnPtrToPtr,
358355
Transmute => crate::mir::CastKind::Transmute,
356+
Subtype => crate::mir::CastKind::Subtype,
359357
}
360358
}
361359
}
@@ -453,7 +451,6 @@ impl<'tcx> Stable<'tcx> for mir::PlaceElem<'tcx> {
453451
// found at https://github.com/rust-lang/rust/pull/117517#issuecomment-1811683486
454452
Downcast(_, idx) => crate::mir::ProjectionElem::Downcast(idx.stable(tables, cx)),
455453
OpaqueCast(ty) => crate::mir::ProjectionElem::OpaqueCast(ty.stable(tables, cx)),
456-
Subtype(ty) => crate::mir::ProjectionElem::Subtype(ty.stable(tables, cx)),
457454
UnwrapUnsafeBinder(..) => todo!("FIXME(unsafe_binders):"),
458455
}
459456
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,10 @@ impl<'tcx> Stable<'tcx> for ty::TyKind<'tcx> {
453453
TyKind::Alias(alias_kind.stable(tables, cx), alias_ty.stable(tables, cx))
454454
}
455455
ty::Param(param_ty) => TyKind::Param(param_ty.stable(tables, cx)),
456-
ty::Bound(debruijn_idx, bound_ty) => {
456+
ty::Bound(ty::BoundVarIndexKind::Canonical, _) => {
457+
unreachable!()
458+
}
459+
ty::Bound(ty::BoundVarIndexKind::Bound(debruijn_idx), bound_ty) => {
457460
TyKind::Bound(debruijn_idx.as_usize(), bound_ty.stable(tables, cx))
458461
}
459462
ty::CoroutineWitness(def_id, args) => TyKind::RigidTy(RigidTy::CoroutineWitness(
@@ -907,7 +910,7 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> {
907910
index: early_reg.index,
908911
name: early_reg.name.to_string(),
909912
}),
910-
ty::ReBound(db_index, bound_reg) => RegionKind::ReBound(
913+
ty::ReBound(ty::BoundVarIndexKind::Bound(db_index), bound_reg) => RegionKind::ReBound(
911914
db_index.as_u32(),
912915
BoundRegion {
913916
var: bound_reg.var.as_u32(),

0 commit comments

Comments
 (0)