diff options
| author | bors <bors@rust-lang.org> | 2021-04-18 07:23:54 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-04-18 07:23:54 +0000 |
| commit | d7c338641466d54bf8d4b2eae5d6865483e1d3f4 (patch) | |
| tree | f5c919c0ff97f9b7d237313ad7e332ddccdbc23b | |
| parent | 67650104959003d1a5828f8d79ad72aa08752055 (diff) | |
| parent | 4d683c0292500738c80ba8824dfaf4d3a0df4ba0 (diff) | |
| download | rust-d7c338641466d54bf8d4b2eae5d6865483e1d3f4.tar.gz rust-d7c338641466d54bf8d4b2eae5d6865483e1d3f4.zip | |
Auto merge of #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: https://github.com/rust-lang/rust/issues/81513
| -rw-r--r-- | library/core/src/raw.rs | 4 | ||||
| -rw-r--r-- | library/core/tests/mem.rs | 3 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 1 | ||||
| -rw-r--r-- | src/test/ui/cast/fat-ptr-cast-rpass.rs | 4 |
4 files changed, 11 insertions, 1 deletions
diff --git a/library/core/src/raw.rs b/library/core/src/raw.rs index 1227d9b01f0..6d1e28f4cd7 100644 --- a/library/core/src/raw.rs +++ b/library/core/src/raw.rs @@ -1,5 +1,9 @@ #![allow(missing_docs)] #![unstable(feature = "raw", issue = "27751")] +#![rustc_deprecated( + since = "1.53.0", + reason = "use pointer metadata APIs instead https://github.com/rust-lang/rust/issues/81513" +)] //! Contains struct definitions for the layout of compiler built-in types. //! diff --git a/library/core/tests/mem.rs b/library/core/tests/mem.rs index c0b75036f4f..dfdbc9305d2 100644 --- a/library/core/tests/mem.rs +++ b/library/core/tests/mem.rs @@ -97,6 +97,9 @@ fn test_transmute_copy() { assert_eq!(1, unsafe { transmute_copy(&1) }); } +// Remove this test when `std::raw` is removed. +// The replacement pointer metadata APIs are tested in library/core/tests/ptr.rs +#[allow(deprecated)] #[test] fn test_transmute() { trait Foo { diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 84f74ef9407..089d43483fc 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -459,6 +459,7 @@ pub use core::pin; #[stable(feature = "rust1", since = "1.0.0")] pub use core::ptr; #[stable(feature = "rust1", since = "1.0.0")] +#[allow(deprecated, deprecated_in_future)] pub use core::raw; #[stable(feature = "rust1", since = "1.0.0")] pub use core::result; diff --git a/src/test/ui/cast/fat-ptr-cast-rpass.rs b/src/test/ui/cast/fat-ptr-cast-rpass.rs index 5f5e621d762..9fa2255e1b3 100644 --- a/src/test/ui/cast/fat-ptr-cast-rpass.rs +++ b/src/test/ui/cast/fat-ptr-cast-rpass.rs @@ -1,5 +1,8 @@ // run-pass +// Remove this file when `std::raw` is removed. +// The replacement pointer metadata APIs are tested in library/core/tests/ptr.rs +#![allow(deprecated)] #![feature(raw)] use std::mem; @@ -37,5 +40,4 @@ fn main() { assert_eq!(b, d); assert_eq!(c, d as usize); - } |
