Skip to content

Commit 3c48d5a

Browse files
authored
Merge branch 'main' into autoharness-support
2 parents fbba41c + 5cf80a8 commit 3c48d5a

File tree

181 files changed

+3516
-1856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+3516
-1856
lines changed

library/Cargo.lock

+14-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

library/alloc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bench = false
1616

1717
[dependencies]
1818
core = { path = "../core", public = true }
19-
compiler_builtins = { version = "=0.1.152", features = ['rustc-dep-of-std'] }
19+
compiler_builtins = { version = "=0.1.155", features = ['rustc-dep-of-std'] }
2020
safety = { path = "../contracts/safety" }
2121

2222
[features]

library/alloc/src/alloc.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ unsafe extern "Rust" {
1616
// otherwise.
1717
#[rustc_allocator]
1818
#[rustc_nounwind]
19-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
19+
#[rustc_std_internal_symbol]
2020
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
2121
#[rustc_deallocator]
2222
#[rustc_nounwind]
23-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
23+
#[rustc_std_internal_symbol]
2424
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
2525
#[rustc_reallocator]
2626
#[rustc_nounwind]
27-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
27+
#[rustc_std_internal_symbol]
2828
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
2929
#[rustc_allocator_zeroed]
3030
#[rustc_nounwind]
31-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
31+
#[rustc_std_internal_symbol]
3232
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
3333

34-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
34+
#[rustc_std_internal_symbol]
3535
static __rust_no_alloc_shim_is_unstable: u8;
3636
}
3737

@@ -360,7 +360,7 @@ unsafe extern "Rust" {
360360
// This is the magic symbol to call the global alloc error handler. rustc generates
361361
// it to call `__rg_oom` if there is a `#[alloc_error_handler]`, or to call the
362362
// default implementations below (`__rdl_oom`) otherwise.
363-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
363+
#[rustc_std_internal_symbol]
364364
fn __rust_alloc_error_handler(size: usize, align: usize) -> !;
365365
}
366366

@@ -427,7 +427,7 @@ pub mod __alloc_error_handler {
427427
unsafe extern "Rust" {
428428
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
429429
// Its value depends on the -Zoom={panic,abort} compiler option.
430-
#[cfg_attr(not(bootstrap), rustc_std_internal_symbol)]
430+
#[rustc_std_internal_symbol]
431431
static __rust_alloc_error_handler_should_panic: u8;
432432
}
433433

library/alloc/src/boxed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ impl<T, A: Allocator> Box<mem::MaybeUninit<T>, A> {
952952
/// assert_eq!(*x, i);
953953
/// }
954954
/// ```
955-
#[stable(feature = "box_uninit_write", since = "CURRENT_RUSTC_VERSION")]
955+
#[stable(feature = "box_uninit_write", since = "1.87.0")]
956956
#[inline]
957957
pub fn write(mut boxed: Self, value: T) -> Box<T, A> {
958958
unsafe {

library/alloc/src/collections/btree/set_val.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(super) struct SetValZST;
99
/// Returns `true` only for type `SetValZST`, `false` for all other types (blanket implementation).
1010
/// `TypeId` requires a `'static` lifetime, use of this trait avoids that restriction.
1111
///
12-
/// [`TypeId`]: std::any::TypeId
12+
/// [`TypeId`]: core::any::TypeId
1313
pub(super) trait IsSetVal {
1414
fn is_set_val() -> bool;
1515
}

library/alloc/src/collections/linked_list.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ impl<T, A: Allocator> LinkedList<T, A> {
11511151
/// assert_eq!(evens.into_iter().collect::<Vec<_>>(), vec![2, 4, 6, 8, 14]);
11521152
/// assert_eq!(odds.into_iter().collect::<Vec<_>>(), vec![1, 3, 5, 9, 11, 13, 15]);
11531153
/// ```
1154-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1154+
#[stable(feature = "extract_if", since = "1.87.0")]
11551155
pub fn extract_if<F>(&mut self, filter: F) -> ExtractIf<'_, T, F, A>
11561156
where
11571157
F: FnMut(&mut T) -> bool,
@@ -1931,7 +1931,7 @@ impl<'a, T, A: Allocator> CursorMut<'a, T, A> {
19311931
}
19321932

19331933
/// An iterator produced by calling `extract_if` on LinkedList.
1934-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1934+
#[stable(feature = "extract_if", since = "1.87.0")]
19351935
#[must_use = "iterators are lazy and do nothing unless consumed"]
19361936
pub struct ExtractIf<
19371937
'a,
@@ -1946,7 +1946,7 @@ pub struct ExtractIf<
19461946
old_len: usize,
19471947
}
19481948

1949-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1949+
#[stable(feature = "extract_if", since = "1.87.0")]
19501950
impl<T, F, A: Allocator> Iterator for ExtractIf<'_, T, F, A>
19511951
where
19521952
F: FnMut(&mut T) -> bool,
@@ -1975,7 +1975,7 @@ where
19751975
}
19761976
}
19771977

1978-
#[stable(feature = "extract_if", since = "CURRENT_RUSTC_VERSION")]
1978+
#[stable(feature = "extract_if", since = "1.87.0")]
19791979
impl<T: fmt::Debug, F> fmt::Debug for ExtractIf<'_, T, F> {
19801980
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
19811981
f.debug_tuple("ExtractIf").field(&self.list).finish()

library/alloc/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ impl CStr {
11161116
/// with the corresponding <code>&[str]</code> slice. Otherwise, it will
11171117
/// replace any invalid UTF-8 sequences with
11181118
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
1119-
/// <code>[Cow]::[Owned]\(&[str])</code> with the result.
1119+
/// <code>[Cow]::[Owned]\([String])</code> with the result.
11201120
///
11211121
/// [str]: prim@str "str"
11221122
/// [Borrowed]: Cow::Borrowed

library/alloc/src/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
//! parameters (corresponding to `format_spec` in [the syntax](#syntax)). These
110110
//! parameters affect the string representation of what's being formatted.
111111
//!
112-
//! The colon `:` in format syntax divides indentifier of the input data and
112+
//! The colon `:` in format syntax divides identifier of the input data and
113113
//! the formatting options, the colon itself does not change anything, only
114114
//! introduces the options.
115115
//!

library/alloc/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
#![feature(async_iterator)]
106106
#![feature(bstr)]
107107
#![feature(bstr_internals)]
108+
#![feature(char_internals)]
108109
#![feature(char_max_len)]
109110
#![feature(clone_to_uninit)]
110111
#![feature(coerce_unsized)]
@@ -136,6 +137,7 @@
136137
#![feature(pattern)]
137138
#![feature(pin_coerce_unsized_trait)]
138139
#![feature(pointer_like_trait)]
140+
#![feature(ptr_alignment_type)]
139141
#![feature(ptr_internals)]
140142
#![feature(ptr_metadata)]
141143
#![feature(set_ptr_value)]

library/alloc/src/raw_vec/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use core::marker::PhantomData;
88
use core::mem::{ManuallyDrop, MaybeUninit, SizedTypeProperties};
9-
use core::ptr::{self, NonNull, Unique};
9+
use core::ptr::{self, Alignment, NonNull, Unique};
1010
use core::{cmp, hint};
1111

1212
#[cfg(not(no_global_oom_handling))]
@@ -177,7 +177,7 @@ impl<T, A: Allocator> RawVec<T, A> {
177177
/// the returned `RawVec`.
178178
#[inline]
179179
pub(crate) const fn new_in(alloc: A) -> Self {
180-
Self { inner: RawVecInner::new_in(alloc, align_of::<T>()), _marker: PhantomData }
180+
Self { inner: RawVecInner::new_in(alloc, Alignment::of::<T>()), _marker: PhantomData }
181181
}
182182

183183
/// Like `with_capacity`, but parameterized over the choice of
@@ -409,8 +409,8 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawVec<T, A> {
409409

410410
impl<A: Allocator> RawVecInner<A> {
411411
#[inline]
412-
const fn new_in(alloc: A, align: usize) -> Self {
413-
let ptr = unsafe { core::mem::transmute(align) };
412+
const fn new_in(alloc: A, align: Alignment) -> Self {
413+
let ptr = Unique::from_non_null(NonNull::without_provenance(align.as_nonzero()));
414414
// `cap: 0` means "unallocated". zero-sized types are ignored.
415415
Self { ptr, cap: ZERO_CAP, alloc }
416416
}
@@ -465,7 +465,7 @@ impl<A: Allocator> RawVecInner<A> {
465465

466466
// Don't allocate here because `Drop` will not deallocate when `capacity` is 0.
467467
if layout.size() == 0 {
468-
return Ok(Self::new_in(alloc, elem_layout.align()));
468+
return Ok(Self::new_in(alloc, elem_layout.alignment()));
469469
}
470470

471471
if let Err(err) = alloc_guard(layout.size()) {

0 commit comments

Comments
 (0)