Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions library/core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,6 @@ impl<T> [MaybeUninit<T>] {
/// # Examples
///
/// ```
/// #![feature(maybe_uninit_write_slice)]
/// use std::mem::MaybeUninit;
///
/// let mut dst = [MaybeUninit::uninit(); 32];
Expand All @@ -1134,8 +1133,6 @@ impl<T> [MaybeUninit<T>] {
/// ```
///
/// ```
/// #![feature(maybe_uninit_write_slice)]
///
/// let mut vec = Vec::with_capacity(32);
/// let src = [0; 16];
///
Expand All @@ -1151,7 +1148,8 @@ impl<T> [MaybeUninit<T>] {
/// ```
///
/// [`write_clone_of_slice`]: slice::write_clone_of_slice
#[unstable(feature = "maybe_uninit_write_slice", issue = "79995")]
#[stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
pub const fn write_copy_of_slice(&mut self, src: &[T]) -> &mut [T]
where
T: Copy,
Expand Down Expand Up @@ -1182,7 +1180,6 @@ impl<T> [MaybeUninit<T>] {
/// # Examples
///
/// ```
/// #![feature(maybe_uninit_write_slice)]
/// use std::mem::MaybeUninit;
///
/// let mut dst = [const { MaybeUninit::uninit() }; 5];
Expand All @@ -1197,8 +1194,6 @@ impl<T> [MaybeUninit<T>] {
/// ```
///
/// ```
/// #![feature(maybe_uninit_write_slice)]
///
/// let mut vec = Vec::with_capacity(32);
/// let src = ["rust", "is", "a", "pretty", "cool", "language"].map(|s| s.to_string());
///
Expand All @@ -1214,7 +1209,7 @@ impl<T> [MaybeUninit<T>] {
/// ```
///
/// [`write_copy_of_slice`]: slice::write_copy_of_slice
#[unstable(feature = "maybe_uninit_write_slice", issue = "79995")]
#[stable(feature = "maybe_uninit_write_slice", since = "CURRENT_RUSTC_VERSION")]
pub fn write_clone_of_slice(&mut self, src: &[T]) -> &mut [T]
where
T: Clone,
Expand Down Expand Up @@ -1409,7 +1404,7 @@ impl<T> [MaybeUninit<T>] {
/// # Examples
///
/// ```
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_write_slice, maybe_uninit_slice)]
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_slice)]
/// use std::mem::MaybeUninit;
///
/// let uninit = [MaybeUninit::new(0x1234u16), MaybeUninit::new(0x5678u16)];
Expand All @@ -1436,7 +1431,7 @@ impl<T> [MaybeUninit<T>] {
/// # Examples
///
/// ```
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_write_slice, maybe_uninit_slice)]
/// #![feature(maybe_uninit_as_bytes, maybe_uninit_slice)]
/// use std::mem::MaybeUninit;
///
/// let mut uninit = [MaybeUninit::<u16>::uninit(), MaybeUninit::<u16>::uninit()];
Expand Down
1 change: 0 additions & 1 deletion library/coretests/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
#![feature(lazy_get)]
#![feature(maybe_uninit_fill)]
#![feature(maybe_uninit_uninit_array_transpose)]
#![feature(maybe_uninit_write_slice)]
#![feature(min_specialization)]
#![feature(never_type)]
#![feature(next_index)]
Expand Down
3 changes: 3 additions & 0 deletions library/proc_macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ rustc-literal-escaper = { version = "0.0.5", features = ["rustc-dep-of-std"] }
[features]
default = ["rustc-dep-of-std"]
rustc-dep-of-std = []

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(bootstrap)'] }
2 changes: 1 addition & 1 deletion library/proc_macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#![feature(staged_api)]
#![feature(allow_internal_unstable)]
#![feature(decl_macro)]
#![feature(maybe_uninit_write_slice)]
#![cfg_attr(bootstrap, feature(maybe_uninit_write_slice))]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually required? I thought we stopped needing most of these after the latest bootstrap reworks…

Copy link
Contributor Author

@thaliaarchi thaliaarchi Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears necessary. With that line removed:

error[E0658]: use of unstable library feature `maybe_uninit_write_slice`
   --> compiler/rustc_proc_macro/../../library/proc_macro/src/bridge/arena.rs:105:27
    |
105 |         let bytes = alloc.write_copy_of_slice(string.as_bytes());
    |                           ^^^^^^^^^^^^^^^^^^^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that's extra strange considering the weird relative library path, but it is what it is. Thanks for verifying.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jieyouxu Is this behavior expected?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, proc-macros can be one of those special cases, because see

# We need to use a separate crate including library/proc_macro as opposed to a
# direct path dependency on library/proc_macro because doing the latter will
# cause two copies of libproc_macro.rlib to end up in the sysroot, breaking
# proc-macro crates. In addition it confuses the workspace_members function of
# bootstrap.

So I believe library/proc_macro can still need cfg-bootstrap bits, but other parts of library should (generally) not need it anymore.

#![feature(negative_impls)]
#![feature(panic_can_unwind)]
#![feature(restricted_std)]
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@
#![feature(ip)]
#![feature(lazy_get)]
#![feature(maybe_uninit_slice)]
#![feature(maybe_uninit_write_slice)]
#![feature(panic_can_unwind)]
#![feature(panic_internals)]
#![feature(pin_coerce_unsized_trait)]
Expand Down
Loading