Skip to content

Commit 7e12d1a

Browse files
committed
Auto merge of rust-lang#141984 - matthiaskrgr:rollup-wy6j9ca, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#137725 (Add `iter` macro) - rust-lang#141455 (std: abort the process on failure to allocate a TLS key) - rust-lang#141569 (Replace ad-hoc ABI "adjustments" with an `AbiMap` to `CanonAbi`) - rust-lang#141698 (Use the informative error as the main const eval error message) - rust-lang#141925 (Remove bootstrap cfgs from library/) - rust-lang#141943 (Remove pre-expansion AST stats.) - rust-lang#141945 (Remove `Path::is_ident`.) - rust-lang#141957 (Add missing `dyn` keywords to tests that do not test for them Part 2) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8208a40 + b8e3663 commit 7e12d1a

File tree

18 files changed

+58
-145
lines changed

18 files changed

+58
-145
lines changed

alloc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ optimize_for_size = ["core/optimize_for_size"]
3232
[lints.rust.unexpected_cfgs]
3333
level = "warn"
3434
check-cfg = [
35-
'cfg(bootstrap)',
3635
'cfg(no_global_oom_handling)',
3736
'cfg(no_rc)',
3837
'cfg(no_sync)',

alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
)]
6767
#![doc(cfg_hide(
6868
not(test),
69-
not(any(test, bootstrap)),
7069
no_global_oom_handling,
7170
not(no_global_oom_handling),
7271
not(no_rc),

alloctests/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ harness = false
3939
[lints.rust.unexpected_cfgs]
4040
level = "warn"
4141
check-cfg = [
42-
'cfg(bootstrap)',
4342
'cfg(no_global_oom_handling)',
4443
'cfg(no_rc)',
4544
'cfg(no_sync)',

core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ debug_typeid = []
2929
[lints.rust.unexpected_cfgs]
3030
level = "warn"
3131
check-cfg = [
32-
'cfg(bootstrap)',
3332
'cfg(no_fp_fmt_parse)',
3433
# core use #[path] imports to portable-simd `core_simd` crate
3534
# and to stdarch `core_arch` crate which messes-up with Cargo list

core/src/intrinsics/mod.rs

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -413,38 +413,7 @@ pub unsafe fn atomic_cxchgweak_seqcst_seqcst<T: Copy>(dst: *mut T, old: T, src:
413413
/// [`atomic`] types via the `load` method. For example, [`AtomicBool::load`].
414414
#[rustc_intrinsic]
415415
#[rustc_nounwind]
416-
#[cfg(not(bootstrap))]
417416
pub unsafe fn atomic_load<T: Copy, const ORD: AtomicOrdering>(src: *const T) -> T;
418-
/// Loads the current value of the pointer.
419-
/// `T` must be an integer or pointer type.
420-
///
421-
/// The stabilized version of this intrinsic is available on the
422-
/// [`atomic`] types via the `load` method by passing
423-
/// [`Ordering::SeqCst`] as the `order`. For example, [`AtomicBool::load`].
424-
#[rustc_intrinsic]
425-
#[rustc_nounwind]
426-
#[cfg(bootstrap)]
427-
pub unsafe fn atomic_load_seqcst<T: Copy>(src: *const T) -> T;
428-
/// Loads the current value of the pointer.
429-
/// `T` must be an integer or pointer type.
430-
///
431-
/// The stabilized version of this intrinsic is available on the
432-
/// [`atomic`] types via the `load` method by passing
433-
/// [`Ordering::Acquire`] as the `order`. For example, [`AtomicBool::load`].
434-
#[rustc_intrinsic]
435-
#[rustc_nounwind]
436-
#[cfg(bootstrap)]
437-
pub unsafe fn atomic_load_acquire<T: Copy>(src: *const T) -> T;
438-
/// Loads the current value of the pointer.
439-
/// `T` must be an integer or pointer type.
440-
///
441-
/// The stabilized version of this intrinsic is available on the
442-
/// [`atomic`] types via the `load` method by passing
443-
/// [`Ordering::Relaxed`] as the `order`. For example, [`AtomicBool::load`].
444-
#[rustc_intrinsic]
445-
#[rustc_nounwind]
446-
#[cfg(bootstrap)]
447-
pub unsafe fn atomic_load_relaxed<T: Copy>(src: *const T) -> T;
448417

449418
/// Stores the value at the specified memory location.
450419
/// `T` must be an integer or pointer type.
@@ -1767,7 +1736,6 @@ pub const unsafe fn arith_offset<T>(dst: *const T, offset: isize) -> *const T;
17671736
/// - `index < PtrMetadata(slice_ptr)`, so the indexing is in-bounds for the slice
17681737
/// - the resulting offsetting is in-bounds of the allocated object, which is
17691738
/// always the case for references, but needs to be upheld manually for pointers
1770-
#[cfg(not(bootstrap))]
17711739
#[rustc_nounwind]
17721740
#[rustc_intrinsic]
17731741
pub const unsafe fn slice_get_unchecked<
@@ -3710,7 +3678,7 @@ pub const fn minnumf128(x: f128, y: f128) -> f128;
37103678
/// Therefore, implementations must not require the user to uphold
37113679
/// any safety invariants.
37123680
#[rustc_nounwind]
3713-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3681+
#[rustc_intrinsic]
37143682
pub const fn minimumf16(x: f16, y: f16) -> f16 {
37153683
if x < y {
37163684
x
@@ -3731,7 +3699,7 @@ pub const fn minimumf16(x: f16, y: f16) -> f16 {
37313699
/// Therefore, implementations must not require the user to uphold
37323700
/// any safety invariants.
37333701
#[rustc_nounwind]
3734-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3702+
#[rustc_intrinsic]
37353703
pub const fn minimumf32(x: f32, y: f32) -> f32 {
37363704
if x < y {
37373705
x
@@ -3752,7 +3720,7 @@ pub const fn minimumf32(x: f32, y: f32) -> f32 {
37523720
/// Therefore, implementations must not require the user to uphold
37533721
/// any safety invariants.
37543722
#[rustc_nounwind]
3755-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3723+
#[rustc_intrinsic]
37563724
pub const fn minimumf64(x: f64, y: f64) -> f64 {
37573725
if x < y {
37583726
x
@@ -3773,7 +3741,7 @@ pub const fn minimumf64(x: f64, y: f64) -> f64 {
37733741
/// Therefore, implementations must not require the user to uphold
37743742
/// any safety invariants.
37753743
#[rustc_nounwind]
3776-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3744+
#[rustc_intrinsic]
37773745
pub const fn minimumf128(x: f128, y: f128) -> f128 {
37783746
if x < y {
37793747
x
@@ -3848,7 +3816,7 @@ pub const fn maxnumf128(x: f128, y: f128) -> f128;
38483816
/// Therefore, implementations must not require the user to uphold
38493817
/// any safety invariants.
38503818
#[rustc_nounwind]
3851-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3819+
#[rustc_intrinsic]
38523820
pub const fn maximumf16(x: f16, y: f16) -> f16 {
38533821
if x > y {
38543822
x
@@ -3868,7 +3836,7 @@ pub const fn maximumf16(x: f16, y: f16) -> f16 {
38683836
/// Therefore, implementations must not require the user to uphold
38693837
/// any safety invariants.
38703838
#[rustc_nounwind]
3871-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3839+
#[rustc_intrinsic]
38723840
pub const fn maximumf32(x: f32, y: f32) -> f32 {
38733841
if x > y {
38743842
x
@@ -3888,7 +3856,7 @@ pub const fn maximumf32(x: f32, y: f32) -> f32 {
38883856
/// Therefore, implementations must not require the user to uphold
38893857
/// any safety invariants.
38903858
#[rustc_nounwind]
3891-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3859+
#[rustc_intrinsic]
38923860
pub const fn maximumf64(x: f64, y: f64) -> f64 {
38933861
if x > y {
38943862
x
@@ -3908,7 +3876,7 @@ pub const fn maximumf64(x: f64, y: f64) -> f64 {
39083876
/// Therefore, implementations must not require the user to uphold
39093877
/// any safety invariants.
39103878
#[rustc_nounwind]
3911-
#[cfg_attr(not(bootstrap), rustc_intrinsic)]
3879+
#[rustc_intrinsic]
39123880
pub const fn maximumf128(x: f128, y: f128) -> f128 {
39133881
if x > y {
39143882
x

core/src/iter/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,8 @@ pub use self::adapters::{Intersperse, IntersperseWith};
420420
issue = "42168"
421421
)]
422422
pub use self::range::Step;
423+
#[unstable(feature = "iter_macro", issue = "none", reason = "generators are unstable")]
424+
pub use self::sources::iter;
423425
#[stable(feature = "iter_empty", since = "1.2.0")]
424426
pub use self::sources::{Empty, empty};
425427
#[unstable(

core/src/iter/sources.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
mod empty;
22
mod from_coroutine;
33
mod from_fn;
4+
mod generator;
45
mod once;
56
mod once_with;
67
mod repeat;
@@ -18,6 +19,8 @@ pub use self::empty::{Empty, empty};
1819
pub use self::from_coroutine::{FromCoroutine, from_coroutine};
1920
#[stable(feature = "iter_from_fn", since = "1.34.0")]
2021
pub use self::from_fn::{FromFn, from_fn};
22+
#[unstable(feature = "iter_macro", issue = "none", reason = "generators are unstable")]
23+
pub use self::generator::iter;
2124
#[stable(feature = "iter_once", since = "1.2.0")]
2225
pub use self::once::{Once, once};
2326
#[stable(feature = "iter_once_with", since = "1.43.0")]

core/src/iter/sources/generator.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// Creates a new closure that returns an iterator where each iteration steps the given
2+
/// generator to the next `yield` statement.
3+
///
4+
/// Similar to [`iter::from_fn`], but allows arbitrary control flow.
5+
///
6+
/// [`iter::from_fn`]: crate::iter::from_fn
7+
///
8+
/// # Examples
9+
///
10+
/// ```
11+
/// #![feature(iter_macro, coroutines)]
12+
/// # #[cfg(not(bootstrap))]
13+
/// # {
14+
///
15+
/// let it = std::iter::iter!{|| {
16+
/// yield 1;
17+
/// yield 2;
18+
/// yield 3;
19+
/// } }();
20+
/// let v: Vec<_> = it.collect();
21+
/// assert_eq!(v, [1, 2, 3]);
22+
/// # }
23+
/// ```
24+
#[unstable(feature = "iter_macro", issue = "none", reason = "generators are unstable")]
25+
#[allow_internal_unstable(coroutines, iter_from_coroutine)]
26+
#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
27+
pub macro iter($($t:tt)*) {
28+
/* compiler-builtin */
29+
}

core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@
187187
//
188188
// Target features:
189189
// tidy-alphabetical-start
190-
#![cfg_attr(bootstrap, feature(avx512_target_feature))]
191190
#![feature(aarch64_unstable_target_feature)]
192191
#![feature(arm_target_feature)]
193192
#![feature(hexagon_target_feature)]
@@ -225,7 +224,6 @@ pub mod assert_matches {
225224

226225
// We don't export this through #[macro_export] for now, to avoid breakage.
227226
#[unstable(feature = "autodiff", issue = "124509")]
228-
#[cfg(not(bootstrap))]
229227
/// Unstable module containing the unstable `autodiff` macro.
230228
pub mod autodiff {
231229
#[unstable(feature = "autodiff", issue = "124509")]

core/src/macros/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,6 @@ pub(crate) mod builtin {
15331533
#[unstable(feature = "autodiff", issue = "124509")]
15341534
#[allow_internal_unstable(rustc_attrs)]
15351535
#[rustc_builtin_macro]
1536-
#[cfg(not(bootstrap))]
15371536
pub macro autodiff_forward($item:item) {
15381537
/* compiler built-in */
15391538
}
@@ -1552,7 +1551,6 @@ pub(crate) mod builtin {
15521551
#[unstable(feature = "autodiff", issue = "124509")]
15531552
#[allow_internal_unstable(rustc_attrs)]
15541553
#[rustc_builtin_macro]
1555-
#[cfg(not(bootstrap))]
15561554
pub macro autodiff_reverse($item:item) {
15571555
/* compiler built-in */
15581556
}

core/src/pin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,6 @@ pub use self::unsafe_pinned::UnsafePinned;
10921092
#[rustc_pub_transparent]
10931093
#[derive(Copy, Clone)]
10941094
pub struct Pin<Ptr> {
1095-
/// Only public for bootstrap.
10961095
pointer: Ptr,
10971096
}
10981097

core/src/slice/index.rs

Lines changed: 4 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Indexing implementations for `[T]`.
22
3-
#[cfg(not(bootstrap))]
43
use crate::intrinsics::slice_get_unchecked;
54
use crate::panic::const_panic;
65
use crate::ub_checks::assert_unsafe_precondition;
@@ -85,22 +84,6 @@ const fn slice_end_index_overflow_fail() -> ! {
8584
// Both the safe and unsafe public methods share these helpers,
8685
// which use intrinsics directly to get *no* extra checks.
8786

88-
#[cfg(bootstrap)]
89-
#[inline(always)]
90-
const unsafe fn get_noubcheck<T>(ptr: *const [T], index: usize) -> *const T {
91-
let ptr = ptr as *const T;
92-
// SAFETY: The caller already checked these preconditions
93-
unsafe { crate::intrinsics::offset(ptr, index) }
94-
}
95-
96-
#[cfg(bootstrap)]
97-
#[inline(always)]
98-
const unsafe fn get_mut_noubcheck<T>(ptr: *mut [T], index: usize) -> *mut T {
99-
let ptr = ptr as *mut T;
100-
// SAFETY: The caller already checked these preconditions
101-
unsafe { crate::intrinsics::offset(ptr, index) }
102-
}
103-
10487
#[inline(always)]
10588
const unsafe fn get_offset_len_noubcheck<T>(
10689
ptr: *const [T],
@@ -231,16 +214,8 @@ unsafe impl<T> SliceIndex<[T]> for usize {
231214
#[inline]
232215
fn get(self, slice: &[T]) -> Option<&T> {
233216
if self < slice.len() {
234-
#[cfg(bootstrap)]
235-
// SAFETY: `self` is checked to be in bounds.
236-
unsafe {
237-
Some(&*get_noubcheck(slice, self))
238-
}
239-
#[cfg(not(bootstrap))]
240217
// SAFETY: `self` is checked to be in bounds.
241-
unsafe {
242-
Some(slice_get_unchecked(slice, self))
243-
}
218+
unsafe { Some(slice_get_unchecked(slice, self)) }
244219
} else {
245220
None
246221
}
@@ -249,16 +224,8 @@ unsafe impl<T> SliceIndex<[T]> for usize {
249224
#[inline]
250225
fn get_mut(self, slice: &mut [T]) -> Option<&mut T> {
251226
if self < slice.len() {
252-
#[cfg(bootstrap)]
253227
// SAFETY: `self` is checked to be in bounds.
254-
unsafe {
255-
Some(&mut *get_mut_noubcheck(slice, self))
256-
}
257-
#[cfg(not(bootstrap))]
258-
// SAFETY: `self` is checked to be in bounds.
259-
unsafe {
260-
Some(slice_get_unchecked(slice, self))
261-
}
228+
unsafe { Some(slice_get_unchecked(slice, self)) }
262229
} else {
263230
None
264231
}
@@ -280,14 +247,7 @@ unsafe impl<T> SliceIndex<[T]> for usize {
280247
// Use intrinsics::assume instead of hint::assert_unchecked so that we don't check the
281248
// precondition of this function twice.
282249
crate::intrinsics::assume(self < slice.len());
283-
#[cfg(bootstrap)]
284-
{
285-
get_noubcheck(slice, self)
286-
}
287-
#[cfg(not(bootstrap))]
288-
{
289-
slice_get_unchecked(slice, self)
290-
}
250+
slice_get_unchecked(slice, self)
291251
}
292252
}
293253

@@ -300,16 +260,7 @@ unsafe impl<T> SliceIndex<[T]> for usize {
300260
(this: usize = self, len: usize = slice.len()) => this < len
301261
);
302262
// SAFETY: see comments for `get_unchecked` above.
303-
unsafe {
304-
#[cfg(bootstrap)]
305-
{
306-
get_mut_noubcheck(slice, self)
307-
}
308-
#[cfg(not(bootstrap))]
309-
{
310-
slice_get_unchecked(slice, self)
311-
}
312-
}
263+
unsafe { slice_get_unchecked(slice, self) }
313264
}
314265

315266
#[inline]

core/src/sync/atomic.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,23 +3822,6 @@ unsafe fn atomic_store<T: Copy>(dst: *mut T, val: T, order: Ordering) {
38223822

38233823
#[inline]
38243824
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3825-
#[cfg(bootstrap)]
3826-
unsafe fn atomic_load<T: Copy>(dst: *const T, order: Ordering) -> T {
3827-
// SAFETY: the caller must uphold the safety contract for `atomic_load`.
3828-
unsafe {
3829-
match order {
3830-
Relaxed => intrinsics::atomic_load_relaxed(dst),
3831-
Acquire => intrinsics::atomic_load_acquire(dst),
3832-
SeqCst => intrinsics::atomic_load_seqcst(dst),
3833-
Release => panic!("there is no such thing as a release load"),
3834-
AcqRel => panic!("there is no such thing as an acquire-release load"),
3835-
}
3836-
}
3837-
}
3838-
3839-
#[inline]
3840-
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
3841-
#[cfg(not(bootstrap))]
38423825
unsafe fn atomic_load<T: Copy>(dst: *const T, order: Ordering) -> T {
38433826
use intrinsics::AtomicOrdering;
38443827
// SAFETY: the caller must uphold the safety contract for `atomic_load`.

0 commit comments

Comments
 (0)