diff --git a/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs b/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs index 54490e005090..e33e83723c10 100644 --- a/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs +++ b/compiler/rustc_mir_build/src/builder/custom/parse/instruction.rs @@ -253,7 +253,6 @@ impl<'a, 'tcx> ParseCtxt<'a, 'tcx> { Ok(Rvalue::BinaryOp(BinOp::Offset, Box::new((ptr, offset)))) }, @call(mir_ptr_metadata, args) => Ok(Rvalue::UnaryOp(UnOp::PtrMetadata, self.parse_operand(args[0])?)), - @call(mir_copy_for_deref, args) => Ok(Rvalue::CopyForDeref(self.parse_place(args[0])?)), ExprKind::Borrow { borrow_kind, arg } => Ok( Rvalue::Ref(self.tcx.lifetimes.re_erased, *borrow_kind, self.parse_place(*arg)?) ), diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 92dd56f3d589..dee5bac7c54e 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1423,7 +1423,6 @@ symbols! { mir_cast_transmute, mir_cast_unsize, mir_checked, - mir_copy_for_deref, mir_debuginfo, mir_deinit, mir_discriminant, diff --git a/library/core/src/intrinsics/mir.rs b/library/core/src/intrinsics/mir.rs index a800ef1cb937..85c5a2c5228e 100644 --- a/library/core/src/intrinsics/mir.rs +++ b/library/core/src/intrinsics/mir.rs @@ -233,7 +233,7 @@ //! //! - Operands implicitly convert to `Use` rvalues. //! - `&`, `&mut`, `addr_of!`, and `addr_of_mut!` all work to create their associated rvalue. -//! - [`CopyForDeref`], [`CastTransmute`], [`CastPtrToPtr`], [`CastUnsize`], and [`Discriminant`] +//! - [`CastTransmute`], [`CastPtrToPtr`], [`CastUnsize`], and [`Discriminant`] //! have associated functions. //! - Unary and binary operations use their normal Rust syntax - `a * b`, `!c`, etc. //! - The binary operation `Offset` can be created via [`Offset`]. @@ -406,7 +406,6 @@ define!( "mir_ptr_metadata", fn PtrMetadata(place: *const P) ->

::Metadata ); -define!("mir_copy_for_deref", fn CopyForDeref(place: T) -> T); define!("mir_retag", fn Retag(place: T)); define!("mir_move", fn Move(place: T) -> T); define!("mir_static", fn Static(s: T) -> &'static T); diff --git a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir b/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir deleted file mode 100644 index b28e96f10eae..000000000000 --- a/tests/mir-opt/building/custom/projections.copy_for_deref.built.after.mir +++ /dev/null @@ -1,12 +0,0 @@ -// MIR for `copy_for_deref` after built - -fn copy_for_deref(_1: (&i32, i32)) -> i32 { - let mut _0: i32; - let mut _2: &i32; - - bb0: { - _2 = deref_copy (_1.0: &i32); - _0 = copy (*_2); - return; - } -} diff --git a/tests/mir-opt/building/custom/projections.rs b/tests/mir-opt/building/custom/projections.rs index 0250b9b84b62..e59eebd9952d 100644 --- a/tests/mir-opt/building/custom/projections.rs +++ b/tests/mir-opt/building/custom/projections.rs @@ -79,19 +79,6 @@ fn simple_index(a: [i32; 10], b: &[i32]) -> i32 { } } -// EMIT_MIR projections.copy_for_deref.built.after.mir -#[custom_mir(dialect = "runtime", phase = "initial")] -fn copy_for_deref(x: (&i32, i32)) -> i32 { - mir! { - let temp: &i32; - { - temp = CopyForDeref(x.0); - RET = *temp; - Return() - } - } -} - fn main() { assert_eq!(unions(U { a: 5 }), 5); assert_eq!(tuples((5, 6)), (5, 6)); @@ -103,7 +90,4 @@ fn main() { assert_eq!(o, Some(10)); assert_eq!(simple_index([0; 10], &[0; 10]), 0); - - let one = 1; - assert_eq!(copy_for_deref((&one, one)), 1); }