Skip to content

Commit fc5237b

Browse files
committed
Auto merge of rust-lang#82122 - bstrie:dep4real, r=dtolnay
Deprecate `intrinsics::drop_in_place` and `collections::Bound`, which accidentally weren't deprecated Fixes rust-lang#82080. I've taken the liberty of updating the `since` values to 1.52, since an unobservable deprecation isn't much of a deprecation (even the detailed release notes never bothered to mention these deprecations). As mentioned in the issue I'm *pretty* sure that using a type alias for `Bound` is semantically equivalent to the re-export; [the reference implies](https://doc.rust-lang.org/reference/items/type-aliases.html) that type aliases only observably differ from types when used on unit structs or tuple structs, whereas `Bound` is an enum.
2 parents 058783c + 069ee04 commit fc5237b

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

core/src/intrinsics.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ use crate::sync::atomic::{self, AtomicBool, AtomicI32, AtomicIsize, AtomicU32, O
6565
#[stable(feature = "drop_in_place", since = "1.8.0")]
6666
#[rustc_deprecated(
6767
reason = "no longer an intrinsic - use `ptr::drop_in_place` directly",
68-
since = "1.18.0"
68+
since = "1.52.0"
6969
)]
70-
pub use crate::ptr::drop_in_place;
70+
#[inline]
71+
pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
72+
// SAFETY: see `ptr::drop_in_place`
73+
unsafe { crate::ptr::drop_in_place(to_drop) }
74+
}
7175

7276
extern "rust-intrinsic" {
7377
// N.B., these intrinsics take raw pointers because they mutate aliased

std/src/collections/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,10 @@
401401
#![stable(feature = "rust1", since = "1.0.0")]
402402

403403
#[stable(feature = "rust1", since = "1.0.0")]
404-
#[rustc_deprecated(reason = "moved to `std::ops::Bound`", since = "1.26.0")]
404+
#[rustc_deprecated(reason = "moved to `std::ops::Bound`", since = "1.52.0")]
405405
#[doc(hidden)]
406-
pub use crate::ops::Bound;
406+
pub type Bound<T> = crate::ops::Bound<T>;
407+
407408
#[stable(feature = "rust1", since = "1.0.0")]
408409
pub use alloc_crate::collections::{binary_heap, btree_map, btree_set};
409410
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)