Skip to content

Commit 42e7571

Browse files
Bump to latest beta compiler
1 parent 4f9b394 commit 42e7571

File tree

12 files changed

+418
-478
lines changed

12 files changed

+418
-478
lines changed

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())

library/core/src/ffi/c_str.rs

+1-1
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]`.

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 {

library/core/src/intrinsics.rs

-31
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
@@ -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-
}

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
}

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).+ $(,)?) {

library/core/src/ptr/const_ptr.rs

+1-9
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)`).

library/core/src/ptr/mut_ptr.rs

+2-20
Original file line numberDiff line numberDiff line change
@@ -473,20 +473,10 @@ impl<T: ?Sized> *mut T {
473473
where
474474
T: Sized,
475475
{
476-
#[cfg(bootstrap)]
477476
// SAFETY: the caller must uphold the safety contract for `offset`.
478477
// The obtained pointer is valid for writes since the caller must
479478
// guarantee that it points to the same allocated object as `self`.
480-
unsafe {
481-
intrinsics::offset(self, count) as *mut T
482-
}
483-
#[cfg(not(bootstrap))]
484-
// SAFETY: the caller must uphold the safety contract for `offset`.
485-
// The obtained pointer is valid for writes since the caller must
486-
// guarantee that it points to the same allocated object as `self`.
487-
unsafe {
488-
intrinsics::offset(self, count)
489-
}
479+
unsafe { intrinsics::offset(self, count) }
490480
}
491481

492482
/// Calculates the offset from a pointer in bytes.
@@ -1026,16 +1016,8 @@ impl<T: ?Sized> *mut T {
10261016
where
10271017
T: Sized,
10281018
{
1029-
#[cfg(bootstrap)]
1030-
// SAFETY: the caller must uphold the safety contract for `offset`.
1031-
unsafe {
1032-
self.offset(count as isize)
1033-
}
1034-
#[cfg(not(bootstrap))]
10351019
// SAFETY: the caller must uphold the safety contract for `offset`.
1036-
unsafe {
1037-
intrinsics::offset(self, count)
1038-
}
1020+
unsafe { intrinsics::offset(self, count) }
10391021
}
10401022

10411023
/// Calculates the offset from a pointer in bytes (convenience for `.byte_offset(count as isize)`).

library/core/tests/clone.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[test]
2-
#[cfg_attr(not(bootstrap), allow(suspicious_double_ref_op))]
2+
#[allow(suspicious_double_ref_op)]
33
fn test_borrowed_clone() {
44
let x = 5;
55
let y: &i32 = &x;

library/core/tests/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
#![feature(utf8_chunks)]
110110
#![feature(is_ascii_octdigit)]
111111
#![feature(get_many_mut)]
112-
#![cfg_attr(not(bootstrap), feature(offset_of))]
112+
#![feature(offset_of)]
113113
#![deny(unsafe_op_in_unsafe_fn)]
114114
#![deny(fuzzy_provenance_casts)]
115115

library/core/tests/mem.rs

+1-10
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ fn const_maybe_uninit() {
366366
}
367367

368368
#[test]
369-
#[cfg(not(bootstrap))]
370369
fn offset_of() {
371370
#[repr(C)]
372371
struct Foo {
@@ -391,7 +390,7 @@ fn offset_of() {
391390
struct Generic<T> {
392391
x: u8,
393392
y: u32,
394-
z: T
393+
z: T,
395394
}
396395

397396
trait Trait {}
@@ -409,7 +408,6 @@ fn offset_of() {
409408
}
410409

411410
#[test]
412-
#[cfg(not(bootstrap))]
413411
fn offset_of_union() {
414412
#[repr(C)]
415413
union Foo {
@@ -429,7 +427,6 @@ fn offset_of_union() {
429427
}
430428

431429
#[test]
432-
#[cfg(not(bootstrap))]
433430
fn offset_of_dst() {
434431
#[repr(C)]
435432
struct Alpha {
@@ -469,7 +466,6 @@ fn offset_of_dst() {
469466
}
470467

471468
#[test]
472-
#[cfg(not(bootstrap))]
473469
fn offset_of_packed() {
474470
#[repr(C, packed)]
475471
struct Foo {
@@ -482,7 +478,6 @@ fn offset_of_packed() {
482478
}
483479

484480
#[test]
485-
#[cfg(not(bootstrap))]
486481
fn offset_of_projection() {
487482
#[repr(C)]
488483
struct Foo {
@@ -503,7 +498,6 @@ fn offset_of_projection() {
503498
}
504499

505500
#[test]
506-
#[cfg(not(bootstrap))]
507501
fn offset_of_alias() {
508502
#[repr(C)]
509503
struct Foo {
@@ -518,7 +512,6 @@ fn offset_of_alias() {
518512
}
519513

520514
#[test]
521-
#[cfg(not(bootstrap))]
522515
fn const_offset_of() {
523516
#[repr(C)]
524517
struct Foo {
@@ -534,7 +527,6 @@ fn const_offset_of() {
534527
}
535528

536529
#[test]
537-
#[cfg(not(bootstrap))]
538530
fn offset_of_without_const_promotion() {
539531
#[repr(C)]
540532
struct Foo<SuppressConstPromotion> {
@@ -555,7 +547,6 @@ fn offset_of_without_const_promotion() {
555547
}
556548

557549
#[test]
558-
#[cfg(not(bootstrap))]
559550
fn offset_of_addr() {
560551
#[repr(C)]
561552
struct Foo {

0 commit comments

Comments
 (0)