Skip to content

Commit e34a3f7

Browse files
committed
Auto merge of rust-lang#97574 - Dylan-DPC:rollup-jq850l6, r=Dylan-DPC
Rollup of 6 pull requests Successful merges: - rust-lang#97089 (Improve settings theme display) - rust-lang#97229 (Document the current aliasing rules for `Box<T>`.) - rust-lang#97371 (Suggest adding a semicolon to a closure without block) - rust-lang#97455 (Stabilize `toowned_clone_into`) - rust-lang#97565 (Add doc alias `memset` to `write_bytes`) - rust-lang#97569 (Remove `memset` alias from `fill_with`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents ab3f04a + d4598d6 commit e34a3f7

File tree

6 files changed

+17
-4
lines changed

6 files changed

+17
-4
lines changed

alloc/src/borrow.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,13 @@ pub trait ToOwned {
6767
/// Basic usage:
6868
///
6969
/// ```
70-
/// # #![feature(toowned_clone_into)]
7170
/// let mut s: String = String::new();
7271
/// "hello".clone_into(&mut s);
7372
///
7473
/// let mut v: Vec<i32> = Vec::new();
7574
/// [1, 2][..].clone_into(&mut v);
7675
/// ```
77-
#[unstable(feature = "toowned_clone_into", reason = "recently added", issue = "41263")]
76+
#[stable(feature = "toowned_clone_into", since = "1.63.0")]
7877
fn clone_into(&self, target: &mut Self::Owned) {
7978
*target = self.to_owned();
8079
}

alloc/src/boxed.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,21 @@
122122
//! definition is just using `T*` can lead to undefined behavior, as
123123
//! described in [rust-lang/unsafe-code-guidelines#198][ucg#198].
124124
//!
125+
//! # Considerations for unsafe code
126+
//!
127+
//! **Warning: This section is not normative and is subject to change, possibly
128+
//! being relaxed in the future! It is a simplified summary of the rules
129+
//! currently implemented in the compiler.**
130+
//!
131+
//! The aliasing rules for `Box<T>` are the same as for `&mut T`. `Box<T>`
132+
//! asserts uniqueness over its content. Using raw pointers derived from a box
133+
//! after that box has been mutated through, moved or borrowed as `&mut T`
134+
//! is not allowed. For more guidance on working with box from unsafe code, see
135+
//! [rust-lang/unsafe-code-guidelines#326][ucg#326].
136+
//!
137+
//!
125138
//! [ucg#198]: https://github.com/rust-lang/unsafe-code-guidelines/issues/198
139+
//! [ucg#326]: https://github.com/rust-lang/unsafe-code-guidelines/issues/326
126140
//! [dereferencing]: core::ops::Deref
127141
//! [`Box::<T>::from_raw(value)`]: Box::from_raw
128142
//! [`Global`]: crate::alloc::Global

core/src/intrinsics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
22872287
/// // Now the box is fine
22882288
/// assert_eq!(*v, 42);
22892289
/// ```
2290+
#[doc(alias = "memset")]
22902291
#[stable(feature = "rust1", since = "1.0.0")]
22912292
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
22922293
#[inline]

core/src/ptr/mut_ptr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,7 @@ impl<T: ?Sized> *mut T {
14121412
/// See [`ptr::write_bytes`] for safety concerns and examples.
14131413
///
14141414
/// [`ptr::write_bytes`]: crate::ptr::write_bytes()
1415+
#[doc(alias = "memset")]
14151416
#[stable(feature = "pointer_methods", since = "1.26.0")]
14161417
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
14171418
#[inline(always)]

core/src/slice/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3083,7 +3083,6 @@ impl<T> [T] {
30833083
/// buf.fill_with(Default::default);
30843084
/// assert_eq!(buf, vec![0; 10]);
30853085
/// ```
3086-
#[doc(alias = "memset")]
30873086
#[stable(feature = "slice_fill_with", since = "1.51.0")]
30883087
pub fn fill_with<F>(&mut self, mut f: F)
30893088
where

std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@
299299
#![feature(map_try_insert)]
300300
#![feature(new_uninit)]
301301
#![feature(thin_box)]
302-
#![feature(toowned_clone_into)]
303302
#![feature(try_reserve_kind)]
304303
#![feature(vec_into_raw_parts)]
305304
#![feature(slice_concat_trait)]

0 commit comments

Comments
 (0)