Skip to content

Commit 2054acb

Browse files
authored
Rollup merge of #112103 - Mark-Simulacrum:bootstrap-update, r=clubby789
Bootstrap update to 1.71 beta Best reviewed by-commit.
2 parents 9e108f8 + 42e7571 commit 2054acb

File tree

22 files changed

+459
-519
lines changed

22 files changed

+459
-519
lines changed

Diff for: compiler/rustc_feature/src/accepted.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ declare_features! (
131131
/// Allows `crate` in paths.
132132
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
133133
/// Allows using `#[debugger_visualizer]` attribute.
134-
(accepted, debugger_visualizer, "CURRENT_RUSTC_VERSION", Some(95939), None),
134+
(accepted, debugger_visualizer, "1.71.0", Some(95939), None),
135135
/// Allows rustc to inject a default alloc_error_handler
136136
(accepted, default_alloc_error_handler, "1.68.0", Some(66741), None),
137137
/// Allows using assigning a default type to type parameters in algebraic data type definitions.
@@ -281,7 +281,7 @@ declare_features! (
281281
/// Allows use of the postfix `?` operator in expressions.
282282
(accepted, question_mark, "1.13.0", Some(31436), None),
283283
/// Allows the use of raw-dylibs (RFC 2627).
284-
(accepted, raw_dylib, "CURRENT_RUSTC_VERSION", Some(58713), None),
284+
(accepted, raw_dylib, "1.71.0", Some(58713), None),
285285
/// Allows keywords to be escaped for use as identifiers.
286286
(accepted, raw_identifiers, "1.30.0", Some(48589), None),
287287
/// Allows relaxing the coherence rules such that

Diff for: compiler/rustc_feature/src/active.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ declare_features! (
165165
/// Allows the `multiple_supertrait_upcastable` lint.
166166
(active, multiple_supertrait_upcastable, "1.69.0", None, None),
167167
/// Allow negative trait bounds. This is an internal-only feature for testing the trait solver!
168-
(incomplete, negative_bounds, "CURRENT_RUSTC_VERSION", None, None),
168+
(incomplete, negative_bounds, "1.71.0", None, None),
169169
/// Allows using `#[omit_gdb_pretty_printer_section]`.
170170
(active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
171171
/// Allows using `#[prelude_import]` on glob `use` items.
@@ -314,15 +314,15 @@ declare_features! (
314314
/// Allows async functions to be declared, implemented, and used in traits.
315315
(active, async_fn_in_trait, "1.66.0", Some(91611), None),
316316
/// Allows builtin # foo() syntax
317-
(active, builtin_syntax, "CURRENT_RUSTC_VERSION", Some(110680), None),
317+
(active, builtin_syntax, "1.71.0", Some(110680), None),
318318
/// Allows `c"foo"` literals.
319-
(active, c_str_literals, "CURRENT_RUSTC_VERSION", Some(105723), None),
319+
(active, c_str_literals, "1.71.0", Some(105723), None),
320320
/// Treat `extern "C"` function as nounwind.
321321
(active, c_unwind, "1.52.0", Some(74990), None),
322322
/// Allows using C-variadics.
323323
(active, c_variadic, "1.34.0", Some(44930), None),
324324
/// Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
325-
(active, cfg_overflow_checks, "CURRENT_RUSTC_VERSION", Some(111466), None),
325+
(active, cfg_overflow_checks, "1.71.0", Some(111466), None),
326326
/// Allows the use of `#[cfg(sanitize = "option")]`; set when -Zsanitizer is used.
327327
(active, cfg_sanitize, "1.41.0", Some(39699), None),
328328
/// Allows `cfg(target_abi = "...")`.
@@ -338,7 +338,7 @@ declare_features! (
338338
/// Allow conditional compilation depending on rust version
339339
(active, cfg_version, "1.45.0", Some(64796), None),
340340
/// Allows to use the `#[cfi_encoding = ""]` attribute.
341-
(active, cfi_encoding, "CURRENT_RUSTC_VERSION", Some(89653), None),
341+
(active, cfi_encoding, "1.71.0", Some(89653), None),
342342
/// Allows `for<...>` on closures and generators.
343343
(active, closure_lifetime_binder, "1.64.0", Some(97362), None),
344344
/// Allows `#[track_caller]` on closures and generators.

Diff for: library/alloc/src/alloc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ extern "Rust" {
3838
#[rustc_nounwind]
3939
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
4040

41-
#[cfg(not(bootstrap))]
4241
static __rust_no_alloc_shim_is_unstable: u8;
4342
}
4443

@@ -96,7 +95,6 @@ pub unsafe fn alloc(layout: Layout) -> *mut u8 {
9695
unsafe {
9796
// Make sure we don't accidentally allow omitting the allocator shim in
9897
// stable code until it is actually stabilized.
99-
#[cfg(not(bootstrap))]
10098
core::ptr::read_volatile(&__rust_no_alloc_shim_is_unstable);
10199

102100
__rust_alloc(layout.size(), layout.align())

Diff for: library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2624,7 +2624,7 @@ impl ToString for String {
26242624
}
26252625

26262626
#[cfg(not(no_global_oom_handling))]
2627-
#[stable(feature = "fmt_arguments_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
2627+
#[stable(feature = "fmt_arguments_to_string_specialization", since = "1.71.0")]
26282628
impl ToString for fmt::Arguments<'_> {
26292629
#[inline]
26302630
fn to_string(&self) -> String {

Diff for: library/core/src/ffi/c_str.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ use crate::str;
8181
#[derive(Hash)]
8282
#[stable(feature = "core_c_str", since = "1.64.0")]
8383
#[rustc_has_incoherent_inherent_impls]
84-
#[cfg_attr(not(bootstrap), lang = "CStr")]
84+
#[lang = "CStr"]
8585
// FIXME:
8686
// `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
8787
// on `CStr` being layout-compatible with `[u8]`.
@@ -531,8 +531,8 @@ impl CStr {
531531
/// # }
532532
/// ```
533533
#[inline]
534-
#[stable(feature = "cstr_is_empty", since = "CURRENT_RUSTC_VERSION")]
535-
#[rustc_const_stable(feature = "cstr_is_empty", since = "CURRENT_RUSTC_VERSION")]
534+
#[stable(feature = "cstr_is_empty", since = "1.71.0")]
535+
#[rustc_const_stable(feature = "cstr_is_empty", since = "1.71.0")]
536536
pub const fn is_empty(&self) -> bool {
537537
// SAFETY: We know there is at least one byte; for empty strings it
538538
// is the NUL terminator.

Diff for: library/core/src/ffi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ mod c_long_definition {
202202
// would be uninhabited and at least dereferencing such pointers would
203203
// be UB.
204204
#[doc = include_str!("c_void.md")]
205-
#[cfg_attr(not(bootstrap), lang = "c_void")]
205+
#[lang = "c_void"]
206206
#[cfg_attr(not(doc), repr(u8))] // work around https://github.com/rust-lang/rust/issues/90435
207207
#[stable(feature = "core_c_void", since = "1.30.0")]
208208
pub enum c_void {

Diff for: library/core/src/hash/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ pub trait BuildHasher {
695695
/// bh.hash_one(&OrderAmbivalentPair(2, 10))
696696
/// );
697697
/// ```
698-
#[stable(feature = "build_hasher_simple_hash_one", since = "CURRENT_RUSTC_VERSION")]
698+
#[stable(feature = "build_hasher_simple_hash_one", since = "1.71.0")]
699699
fn hash_one<T: Hash>(&self, x: T) -> u64
700700
where
701701
Self: Sized,

Diff for: library/core/src/intrinsics.rs

+1-32
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,6 @@ extern "rust-intrinsic" {
13851385
///
13861386
/// This is not expected to ever be exposed directly to users, rather it
13871387
/// may eventually be exposed through some more-constrained API.
1388-
#[cfg(not(bootstrap))]
13891388
#[rustc_const_stable(feature = "const_transmute", since = "1.56.0")]
13901389
#[rustc_nounwind]
13911390
pub fn transmute_unchecked<Src, Dst>(src: Src) -> Dst;
@@ -1425,19 +1424,11 @@ extern "rust-intrinsic" {
14251424
/// returned value will result in undefined behavior.
14261425
///
14271426
/// The stabilized version of this intrinsic is [`pointer::offset`].
1428-
#[cfg(not(bootstrap))]
14291427
#[must_use = "returns a new pointer rather than modifying its argument"]
14301428
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
14311429
#[rustc_nounwind]
14321430
pub fn offset<Ptr, Delta>(dst: Ptr, offset: Delta) -> Ptr;
14331431

1434-
/// The bootstrap version of this is more restricted.
1435-
#[cfg(bootstrap)]
1436-
#[must_use = "returns a new pointer rather than modifying its argument"]
1437-
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
1438-
#[rustc_nounwind]
1439-
pub fn offset<T>(dst: *const T, offset: isize) -> *const T;
1440-
14411432
/// Calculates the offset from a pointer, potentially wrapping.
14421433
///
14431434
/// This is implemented as an intrinsic to avoid converting to and from an
@@ -2260,7 +2251,7 @@ extern "rust-intrinsic" {
22602251
/// This intrinsic can *only* be called where the pointer is a local without
22612252
/// projections (`read_via_copy(ptr)`, not `read_via_copy(*ptr)`) so that it
22622253
/// trivially obeys runtime-MIR rules about derefs in operands.
2263-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
2254+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
22642255
#[rustc_nounwind]
22652256
pub fn read_via_copy<T>(ptr: *const T) -> T;
22662257

@@ -2270,7 +2261,6 @@ extern "rust-intrinsic" {
22702261
/// This intrinsic can *only* be called where the pointer is a local without
22712262
/// projections (`write_via_move(ptr, x)`, not `write_via_move(*ptr, x)`) so
22722263
/// that it trivially obeys runtime-MIR rules about derefs in operands.
2273-
#[cfg(not(bootstrap))]
22742264
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
22752265
#[rustc_nounwind]
22762266
pub fn write_via_move<T>(ptr: *mut T, value: T);
@@ -2832,24 +2822,3 @@ pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
28322822
write_bytes(dst, val, count)
28332823
}
28342824
}
2835-
2836-
/// Polyfill for bootstrap
2837-
#[cfg(bootstrap)]
2838-
pub const unsafe fn transmute_unchecked<Src, Dst>(src: Src) -> Dst {
2839-
use crate::mem::*;
2840-
// SAFETY: It's a transmute -- the caller promised it's fine.
2841-
unsafe { transmute_copy(&ManuallyDrop::new(src)) }
2842-
}
2843-
2844-
/// Polyfill for bootstrap
2845-
#[cfg(bootstrap)]
2846-
pub const unsafe fn write_via_move<T>(ptr: *mut T, value: T) {
2847-
use crate::mem::*;
2848-
// SAFETY: the caller must guarantee that `dst` is valid for writes.
2849-
// `dst` cannot overlap `src` because the caller has mutable access
2850-
// to `dst` while `src` is owned by this function.
2851-
unsafe {
2852-
copy_nonoverlapping::<T>(&value, ptr, 1);
2853-
forget(value);
2854-
}
2855-
}

Diff for: library/core/src/marker.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -971,15 +971,14 @@ pub trait Tuple {}
971971
pub trait PointerLike {}
972972

973973
/// A marker for types which can be used as types of `const` generic parameters.
974-
#[cfg_attr(not(bootstrap), lang = "const_param_ty")]
974+
#[lang = "const_param_ty"]
975975
#[unstable(feature = "adt_const_params", issue = "95174")]
976976
#[rustc_on_unimplemented(message = "`{Self}` can't be used as a const parameter type")]
977977
pub trait ConstParamTy: StructuralEq {}
978978

979979
/// Derive macro generating an impl of the trait `ConstParamTy`.
980980
#[rustc_builtin_macro]
981981
#[unstable(feature = "adt_const_params", issue = "95174")]
982-
#[cfg(not(bootstrap))]
983982
pub macro ConstParamTy($item:item) {
984983
/* compiler built-in */
985984
}

Diff for: library/core/src/mem/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ pub const fn replace<T>(dest: &mut T, src: T) -> T {
968968
/// Integers and other types implementing [`Copy`] are unaffected by `drop`.
969969
///
970970
/// ```
971-
/// # #![cfg_attr(not(bootstrap), allow(dropping_copy_types))]
971+
/// # #![allow(dropping_copy_types)]
972972
/// #[derive(Copy, Clone)]
973973
/// struct Foo(u8);
974974
///
@@ -1316,7 +1316,6 @@ impl<T> SizedTypeProperties for T {}
13161316
///
13171317
/// assert_eq!(mem::offset_of!(NestedA, b.0), 0);
13181318
/// ```
1319-
#[cfg(not(bootstrap))]
13201319
#[unstable(feature = "offset_of", issue = "106655")]
13211320
#[allow_internal_unstable(builtin_syntax)]
13221321
pub macro offset_of($Container:ty, $($fields:tt).+ $(,)?) {

Diff for: library/core/src/num/nonzero.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ macro_rules! nonzero_signed_operations {
769769
/// ```
770770
#[must_use]
771771
#[inline]
772-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
773-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
772+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
773+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
774774
pub const fn is_positive(self) -> bool {
775775
self.get().is_positive()
776776
}
@@ -794,8 +794,8 @@ macro_rules! nonzero_signed_operations {
794794
/// ```
795795
#[must_use]
796796
#[inline]
797-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
798-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
797+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
798+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
799799
pub const fn is_negative(self) -> bool {
800800
self.get().is_negative()
801801
}
@@ -819,8 +819,8 @@ macro_rules! nonzero_signed_operations {
819819
/// # }
820820
/// ```
821821
#[inline]
822-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
823-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
822+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
823+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
824824
pub const fn checked_neg(self) -> Option<$Ty> {
825825
if let Some(result) = self.get().checked_neg() {
826826
// SAFETY: negation of nonzero cannot yield zero values.
@@ -851,8 +851,8 @@ macro_rules! nonzero_signed_operations {
851851
/// # }
852852
/// ```
853853
#[inline]
854-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
855-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
854+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
855+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
856856
pub const fn overflowing_neg(self) -> ($Ty, bool) {
857857
let (result, overflow) = self.get().overflowing_neg();
858858
// SAFETY: negation of nonzero cannot yield zero values.
@@ -884,8 +884,8 @@ macro_rules! nonzero_signed_operations {
884884
/// # }
885885
/// ```
886886
#[inline]
887-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
888-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
887+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
888+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
889889
pub const fn saturating_neg(self) -> $Ty {
890890
if let Some(result) = self.checked_neg() {
891891
return result;
@@ -916,16 +916,16 @@ macro_rules! nonzero_signed_operations {
916916
/// # }
917917
/// ```
918918
#[inline]
919-
#[stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
920-
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "CURRENT_RUSTC_VERSION")]
919+
#[stable(feature = "nonzero_negation_ops", since = "1.71.0")]
920+
#[rustc_const_stable(feature = "nonzero_negation_ops", since = "1.71.0")]
921921
pub const fn wrapping_neg(self) -> $Ty {
922922
let result = self.get().wrapping_neg();
923923
// SAFETY: negation of nonzero cannot yield zero values.
924924
unsafe { $Ty::new_unchecked(result) }
925925
}
926926
}
927927

928-
#[stable(feature = "signed_nonzero_neg", since = "CURRENT_RUSTC_VERSION")]
928+
#[stable(feature = "signed_nonzero_neg", since = "1.71.0")]
929929
impl Neg for $Ty {
930930
type Output = $Ty;
931931

@@ -937,7 +937,7 @@ macro_rules! nonzero_signed_operations {
937937
}
938938

939939
forward_ref_unop! { impl Neg, neg for $Ty,
940-
#[stable(feature = "signed_nonzero_neg", since = "CURRENT_RUSTC_VERSION")] }
940+
#[stable(feature = "signed_nonzero_neg", since = "1.71.0")] }
941941
)+
942942
}
943943
}

Diff for: library/core/src/ptr/const_ptr.rs

+3-11
Original file line numberDiff line numberDiff line change
@@ -916,16 +916,8 @@ impl<T: ?Sized> *const T {
916916
where
917917
T: Sized,
918918
{
919-
#[cfg(bootstrap)]
920919
// SAFETY: the caller must uphold the safety contract for `offset`.
921-
unsafe {
922-
self.offset(count as isize)
923-
}
924-
#[cfg(not(bootstrap))]
925-
// SAFETY: the caller must uphold the safety contract for `offset`.
926-
unsafe {
927-
intrinsics::offset(self, count)
928-
}
920+
unsafe { intrinsics::offset(self, count) }
929921
}
930922

931923
/// Calculates the offset from a pointer in bytes (convenience for `.byte_offset(count as isize)`).
@@ -1195,7 +1187,7 @@ impl<T: ?Sized> *const T {
11951187
///
11961188
/// [`ptr::read`]: crate::ptr::read()
11971189
#[stable(feature = "pointer_methods", since = "1.26.0")]
1198-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1190+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
11991191
#[inline]
12001192
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12011193
pub const unsafe fn read(self) -> T
@@ -1236,7 +1228,7 @@ impl<T: ?Sized> *const T {
12361228
///
12371229
/// [`ptr::read_unaligned`]: crate::ptr::read_unaligned()
12381230
#[stable(feature = "pointer_methods", since = "1.26.0")]
1239-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1231+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
12401232
#[inline]
12411233
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12421234
pub const unsafe fn read_unaligned(self) -> T

Diff for: library/core/src/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ pub const unsafe fn replace<T>(dst: *mut T, mut src: T) -> T {
11391139
/// [valid]: self#safety
11401140
#[inline]
11411141
#[stable(feature = "rust1", since = "1.0.0")]
1142-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1142+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
11431143
#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
11441144
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
11451145
pub const unsafe fn read<T>(src: *const T) -> T {
@@ -1256,7 +1256,7 @@ pub const unsafe fn read<T>(src: *const T) -> T {
12561256
/// ```
12571257
#[inline]
12581258
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
1259-
#[rustc_const_stable(feature = "const_ptr_read", since = "CURRENT_RUSTC_VERSION")]
1259+
#[rustc_const_stable(feature = "const_ptr_read", since = "1.71.0")]
12601260
#[rustc_allow_const_fn_unstable(const_mut_refs, const_maybe_uninit_as_mut_ptr)]
12611261
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
12621262
pub const unsafe fn read_unaligned<T>(src: *const T) -> T {

0 commit comments

Comments
 (0)