Skip to content

Commit 2aad7af

Browse files
authored
Rollup merge of #164146 - maxdexh:nuke-unique, r=hanna-kruppe
Nuke `Unique` (and `ptr_internals`)
2 parents d9f802f + 32fd83f commit 2aad7af

16 files changed

Lines changed: 28 additions & 337 deletions

File tree

‎compiler/rustc_codegen_ssa/src/mir/retag.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<'a, 'tcx, V> RetagPlan<V> {
151151
let boxed_ty = layout.ty.expect_boxed_ty();
152152
let boxed_layout = bx.layout_of(boxed_ty);
153153
if let Some(mut plan) = Self::emit_retag(bx, boxed_layout, None, is_fn_entry) {
154-
// `Unique<T>`
154+
// `BoxRaw<T>`
155155
let unique = layout.field(bx, 0);
156156
assert_eq!(unique.fields.count(), 2);
157157
plan = plan.for_field(FieldIdx::ZERO);

‎library/alloc/src/lib.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
#![feature(pin_coerce_unsized_trait)]
158158
#![feature(ptr_alignment_type)]
159159
#![feature(ptr_cast_slice)]
160-
#![feature(ptr_internals)]
161160
#![feature(ptr_metadata)]
162161
#![feature(random)]
163162
#![feature(raw_os_error_ty)]

‎library/core/src/panic/unwind_safe.rs‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::future::Future;
55
use crate::marker::PointeeSized;
66
use crate::ops::{Deref, DerefMut};
77
use crate::pin::Pin;
8-
use crate::ptr::{NonNull, Unique};
8+
use crate::ptr::NonNull;
99
use crate::task::{Context, Poll};
1010

1111
/// A marker trait which represents "panic safe" types in Rust.
@@ -186,8 +186,6 @@ impl<T: RefUnwindSafe + PointeeSized> UnwindSafe for &T {}
186186
impl<T: RefUnwindSafe + PointeeSized> UnwindSafe for *const T {}
187187
#[stable(feature = "catch_unwind", since = "1.9.0")]
188188
impl<T: RefUnwindSafe + PointeeSized> UnwindSafe for *mut T {}
189-
#[unstable(feature = "ptr_internals", issue = "none")]
190-
impl<T: UnwindSafe + PointeeSized> UnwindSafe for Unique<T> {}
191189
#[stable(feature = "nonnull", since = "1.25.0")]
192190
impl<T: RefUnwindSafe + PointeeSized> UnwindSafe for NonNull<T> {}
193191
#[stable(feature = "catch_unwind", since = "1.9.0")]

‎library/core/src/ptr/mod.rs‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,10 +447,6 @@ mod non_null;
447447
#[stable(feature = "nonnull", since = "1.25.0")]
448448
pub use non_null::NonNull;
449449

450-
mod unique;
451-
#[unstable(feature = "ptr_internals", issue = "none")]
452-
pub use unique::Unique;
453-
454450
mod const_ptr;
455451
mod mut_ptr;
456452

‎library/core/src/ptr/non_null.rs‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::marker::{Destruct, PointeeSized, Unsize};
44
use crate::mem::{MaybeUninit, SizedTypeProperties, transmute};
55
use crate::num::NonZero;
66
use crate::ops::{CoerceUnsized, DispatchFromDyn};
7-
use crate::ptr::Unique;
87
use crate::slice::{self, SliceIndex};
98
use crate::ub_checks::assert_unsafe_precondition;
109
use crate::{fmt, hash, intrinsics, mem, ptr};
@@ -1691,15 +1690,6 @@ impl<T: PointeeSized> hash::Hash for NonNull<T> {
16911690
}
16921691
}
16931692

1694-
#[unstable(feature = "ptr_internals", issue = "none")]
1695-
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
1696-
const impl<T: PointeeSized> From<Unique<T>> for NonNull<T> {
1697-
#[inline]
1698-
fn from(unique: Unique<T>) -> Self {
1699-
unique.as_non_null_ptr()
1700-
}
1701-
}
1702-
17031693
#[stable(feature = "nonnull", since = "1.25.0")]
17041694
#[rustc_const_unstable(feature = "const_convert", issue = "143773")]
17051695
const impl<T: PointeeSized> From<&mut T> for NonNull<T> {

‎library/core/src/ptr/unique.rs‎

Lines changed: 0 additions & 214 deletions
This file was deleted.

‎src/tools/tidy/src/issues.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,6 @@ ui/feature-gates/issue-43106-gating-of-proc_macro_derive.rs
977977
ui/feature-gates/issue-43106-gating-of-stable.rs
978978
ui/feature-gates/issue-43106-gating-of-test.rs
979979
ui/feature-gates/issue-43106-gating-of-unstable.rs
980-
ui/feature-gates/issue-49983-see-issue-0.rs
981980
ui/fmt/issue-103826.rs
982981
ui/fmt/issue-104142.rs
983982
ui/fmt/issue-23781.rs

‎tests/debuginfo/marker-types.rs‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,9 @@
2121
//@ cdb-check: [capacity] : 0x4 [Type: unsigned [...]]
2222
//@ cdb-check: [chars] : "this"
2323

24-
//@ cdb-command: dx unique
25-
//@ cdb-check:unique : Unique(0x[...]: (0x2a, 4321)) [Type: core::ptr::unique::Unique<tuple$<u64,i32> >]
26-
//@ cdb-check: [<Raw View>] [Type: core::ptr::unique::Unique<tuple$<u64,i32> >]
27-
//@ cdb-check: [0] : 0x2a [Type: unsigned __int64]
28-
//@ cdb-check: [1] : 4321 [Type: int]
29-
30-
#![feature(ptr_internals)]
31-
3224
use std::mem::ManuallyDrop;
3325
use std::pin::Pin;
34-
use std::ptr::{NonNull, Unique};
26+
use std::ptr::NonNull;
3527

3628
fn main() {
3729
let nonnull: NonNull<_> = (&12u32).into();
@@ -41,9 +33,7 @@ fn main() {
4133
let mut s = "this".to_string();
4234
let pin = Pin::new(&mut s);
4335

44-
let unique: Unique<_> = (&mut (42u64, 4321i32)).into();
45-
4636
zzz(); // #break
4737
}
4838

49-
fn zzz() { }
39+
fn zzz() {}

‎tests/ui/consts/const-ptr-unique-rpass.rs‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎tests/ui/consts/const-ptr-unique.rs‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)