Skip to content

Commit 0cb1d33

Browse files
committed
Auto merge of rust-lang#84207 - SimonSapin:deprecate-core-raw, r=dtolnay
Deprecate the core::raw / std::raw module It only contains the `TraitObject` struct which exposes components of wide pointer. Pointer metadata APIs are designed to replace this: rust-lang#81513
2 parents ec75f84 + b95105d commit 0cb1d33

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

core/src/raw.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
#![allow(missing_docs)]
22
#![unstable(feature = "raw", issue = "27751")]
3+
#![rustc_deprecated(
4+
since = "1.53.0",
5+
reason = "use pointer metadata APIs instead https://github.com/rust-lang/rust/issues/81513"
6+
)]
37

48
//! Contains struct definitions for the layout of compiler built-in types.
59
//!

core/tests/mem.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ fn test_transmute_copy() {
9797
assert_eq!(1, unsafe { transmute_copy(&1) });
9898
}
9999

100+
// Remove this test when `std::raw` is removed.
101+
// The replacement pointer metadata APIs are tested in library/core/tests/ptr.rs
102+
#[allow(deprecated)]
100103
#[test]
101104
fn test_transmute() {
102105
trait Foo {

std/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ pub use core::pin;
459459
#[stable(feature = "rust1", since = "1.0.0")]
460460
pub use core::ptr;
461461
#[stable(feature = "rust1", since = "1.0.0")]
462+
#[allow(deprecated, deprecated_in_future)]
462463
pub use core::raw;
463464
#[stable(feature = "rust1", since = "1.0.0")]
464465
pub use core::result;

0 commit comments

Comments
 (0)