Skip to content

Commit 5c9519e

Browse files
committed
Auto merge of rust-lang#140151 - RalfJung:drop_in_place-is-not-an-intrinsic, r=<try>
remove intrinsics::drop_in_place This was only ever accidentally stable, and has been marked as deprecated since Rust 1.52, released almost 4 years ago. We've removed the old serialization `derive`s, maybe we can remove this one as well? As suggested by `@jhpratt,` let's see what crater says for this one.
2 parents fae7785 + f8b0768 commit 5c9519e

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

library/core/src/intrinsics/mod.rs

-9
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,6 @@ pub mod simd;
7474
#[cfg(all(target_has_atomic = "8", target_has_atomic = "32", target_has_atomic = "ptr"))]
7575
use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, Ordering};
7676

77-
#[stable(feature = "drop_in_place", since = "1.8.0")]
78-
#[rustc_allowed_through_unstable_modules = "import this function via `std::ptr` instead"]
79-
#[deprecated(note = "no longer an intrinsic - use `ptr::drop_in_place` directly", since = "1.52.0")]
80-
#[inline]
81-
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
82-
// SAFETY: see `ptr::drop_in_place`
83-
unsafe { crate::ptr::drop_in_place(to_drop) }
84-
}
85-
8677
// N.B., these intrinsics take raw pointers because they mutate aliased
8778
// memory, which is not valid for either `&` or `&mut`.
8879

tests/ui/stability-attribute/issue-99286-stable-intrinsics.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
#![allow(unused_imports)]
99
#![allow(deprecated)]
1010

11-
use std::intrinsics::drop_in_place as _;
1211
use std::intrinsics::copy_nonoverlapping as _;
1312
use std::intrinsics::copy as _;
1413
use std::intrinsics::write_bytes as _;
15-
use std::intrinsics::{drop_in_place, copy_nonoverlapping, copy, write_bytes};
14+
use std::intrinsics::{copy_nonoverlapping, copy, write_bytes};
1615

1716
fn main() {}

0 commit comments

Comments
 (0)