Skip to content

Commit 001c6b1

Browse files
authored
Rollup merge of #157876 - jhpratt:stabilize-box-as-ptr, r=Mark-Simulacrum
Stabilize `#![feature(box_as_ptr)]` Tracking issue: #129090 Completed FCP: #129090 (comment)
2 parents 4ffea22 + 416176f commit 001c6b1

6 files changed

Lines changed: 4 additions & 13 deletions

File tree

compiler/rustc_middle/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
// tidy-alphabetical-start
2828
#![allow(internal_features)]
2929
#![allow(rustc::direct_use_of_rustc_type_ir)]
30+
#![cfg_attr(bootstrap, feature(box_as_ptr))]
3031
#![cfg_attr(doc, feature(intra_doc_pointers))]
3132
#![feature(allocator_api)]
3233
#![feature(associated_type_defaults)]
33-
#![feature(box_as_ptr)]
3434
#![feature(closure_track_caller)]
3535
#![feature(const_default)]
3636
#![feature(const_trait_impl)]

library/alloc/src/boxed.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,8 +1763,6 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
17631763
/// Due to the aliasing guarantee, the following code is legal:
17641764
///
17651765
/// ```rust
1766-
/// #![feature(box_as_ptr)]
1767-
///
17681766
/// unsafe {
17691767
/// let mut b = Box::new(0);
17701768
/// let ptr1 = Box::as_mut_ptr(&mut b);
@@ -1778,7 +1776,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
17781776
///
17791777
/// [`as_mut_ptr`]: Self::as_mut_ptr
17801778
/// [`as_ptr`]: Self::as_ptr
1781-
#[unstable(feature = "box_as_ptr", issue = "129090")]
1779+
#[stable(feature = "box_as_ptr", since = "CURRENT_RUSTC_VERSION")]
17821780
#[rustc_never_returns_null_ptr]
17831781
#[rustc_as_ptr]
17841782
#[inline]
@@ -1809,8 +1807,6 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
18091807
/// Due to the aliasing guarantee, the following code is legal:
18101808
///
18111809
/// ```rust
1812-
/// #![feature(box_as_ptr)]
1813-
///
18141810
/// unsafe {
18151811
/// let mut v = Box::new(0);
18161812
/// let ptr1 = Box::as_ptr(&v);
@@ -1827,7 +1823,7 @@ impl<T: ?Sized, A: Allocator> Box<T, A> {
18271823
///
18281824
/// [`as_mut_ptr`]: Self::as_mut_ptr
18291825
/// [`as_ptr`]: Self::as_ptr
1830-
#[unstable(feature = "box_as_ptr", issue = "129090")]
1826+
#[stable(feature = "box_as_ptr", since = "CURRENT_RUSTC_VERSION")]
18311827
#[rustc_never_returns_null_ptr]
18321828
#[rustc_as_ptr]
18331829
#[inline]

library/core/src/mem/maybe_dangling.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use crate::{mem, ptr};
1313
/// executing (particularly in concurrent code). As a somewhat absurd example, consider this code:
1414
///
1515
/// ```rust,no_run
16-
/// #![feature(box_as_ptr)]
1716
/// # use std::alloc::{dealloc, Layout};
1817
/// # use std::mem;
1918
///
@@ -35,7 +34,7 @@ use crate::{mem, ptr};
3534
///
3635
// FIXME: remove `no_run` once the semantics are actually implemented
3736
/// ```rust,no_run
38-
/// #![feature(maybe_dangling, box_as_ptr)]
37+
/// #![feature(maybe_dangling)]
3938
/// # use std::alloc::{dealloc, Layout};
4039
/// # use std::mem::{self, MaybeDangling};
4140
///

src/tools/miri/tests/genmc/fail/atomics/atomic_ptr_invalid_provenance.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// We have two variants, one where we send such a pointer to GenMC, and one where we make it on the GenMC side.
55

66
#![no_main]
7-
#![feature(box_as_ptr)]
87

98
use std::sync::atomic::AtomicPtr;
109
use std::sync::atomic::Ordering::*;

src/tools/miri/tests/native-lib/pass/ptr_write_access.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
//@[trace] compile-flags: -Zmiri-native-lib-enable-tracing
44
//@compile-flags: -Zmiri-permissive-provenance
55

6-
#![feature(box_as_ptr)]
7-
86
use std::mem::MaybeUninit;
97
use std::ptr;
108

src/tools/miri/tests/pass/tree_borrows/cell-inside-box.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@revisions: tree tree_implicit_writes
22
//@[tree_implicit_writes]compile-flags: -Zmiri-tree-borrows-implicit-writes
33
//@compile-flags: -Zmiri-tree-borrows
4-
#![feature(box_as_ptr)]
54
#[path = "../../utils/mod.rs"]
65
#[macro_use]
76
mod utils;

0 commit comments

Comments
 (0)