Skip to content

Commit b454991

Browse files
Finish bumping stage0
It looks like the last time had left some remaining cfg's -- which made me think that the stage0 bump was actually successful. This brings us to a released 1.62 beta though.
1 parent 4614711 commit b454991

File tree

19 files changed

+347
-466
lines changed

19 files changed

+347
-466
lines changed

compiler/rustc_codegen_gcc/src/intrinsic/simd.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use crate::builder::Builder;
1313

1414
pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(bx: &mut Builder<'a, 'gcc, 'tcx>, name: Symbol, callee_ty: Ty<'tcx>, args: &[OperandRef<'tcx, RValue<'gcc>>], ret_ty: Ty<'tcx>, llret_ty: Type<'gcc>, span: Span) -> Result<RValue<'gcc>, ()> {
1515
// macros for error handling:
16+
#[allow(unused_macro_rules)]
1617
macro_rules! emit_error {
1718
($msg: tt) => {
1819
emit_error!($msg, )

compiler/rustc_codegen_llvm/src/intrinsic.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
816816
span: Span,
817817
) -> Result<&'ll Value, ()> {
818818
// macros for error handling:
819-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
819+
#[allow(unused_macro_rules)]
820820
macro_rules! emit_error {
821821
($msg: tt) => {
822822
emit_error!($msg, )
@@ -1145,7 +1145,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
11451145
span: Span,
11461146
args: &[OperandRef<'tcx, &'ll Value>],
11471147
) -> Result<&'ll Value, ()> {
1148-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
1148+
#[allow(unused_macro_rules)]
11491149
macro_rules! emit_error {
11501150
($msg: tt) => {
11511151
emit_error!($msg, )

compiler/rustc_feature/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
//! even if it is stabilized or removed, *do not remove it*. Instead, move the
1212
//! symbol to the `accepted` or `removed` modules respectively.
1313
14-
#![cfg_attr(bootstrap, feature(derive_default_enum))]
1514
#![feature(once_cell)]
1615

1716
mod accepted;

compiler/rustc_infer/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1717
#![feature(box_patterns)]
1818
#![feature(control_flow_enum)]
19-
#![cfg_attr(bootstrap, feature(derive_default_enum))]
2019
#![feature(extend_one)]
2120
#![feature(label_break_value)]
2221
#![feature(let_chains)]

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![feature(backtrace)]
3030
#![feature(box_patterns)]
3131
#![feature(core_intrinsics)]
32-
#![cfg_attr(bootstrap, feature(derive_default_enum))]
3332
#![feature(discriminant_kind)]
3433
#![feature(exhaustive_patterns)]
3534
#![feature(get_mut_unchecked)]

compiler/rustc_middle/src/mir/visit.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ macro_rules! make_mir_visitor {
258258
// for best performance, we want to use an iterator rather
259259
// than a for-loop, to avoid calling `body::Body::invalidate` for
260260
// each basic block.
261-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
261+
#[allow(unused_macro_rules)]
262262
macro_rules! basic_blocks {
263263
(mut) => (body.basic_blocks_mut().iter_enumerated_mut());
264264
() => (body.basic_blocks().iter_enumerated());
@@ -280,7 +280,7 @@ macro_rules! make_mir_visitor {
280280
self.visit_local_decl(local, & $($mutability)? body.local_decls[local]);
281281
}
282282

283-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
283+
#[allow(unused_macro_rules)]
284284
macro_rules! type_annotations {
285285
(mut) => (body.user_type_annotations.iter_enumerated_mut());
286286
() => (body.user_type_annotations.iter_enumerated());
@@ -933,7 +933,7 @@ macro_rules! make_mir_visitor {
933933
body: &$($mutability)? Body<'tcx>,
934934
location: Location
935935
) {
936-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
936+
#[allow(unused_macro_rules)]
937937
macro_rules! basic_blocks {
938938
(mut) => (body.basic_blocks_mut());
939939
() => (body.basic_blocks());

compiler/rustc_session/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(if_let_guard)]
22
#![feature(let_chains)]
3-
#![cfg_attr(bootstrap, feature(derive_default_enum))]
43
#![feature(let_else)]
54
#![feature(min_specialization)]
65
#![feature(never_type)]

compiler/rustc_trait_selection/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1515
#![feature(box_patterns)]
1616
#![feature(control_flow_enum)]
17-
#![cfg_attr(bootstrap, feature(derive_default_enum))]
1817
#![feature(drain_filter)]
1918
#![feature(hash_drain_filter)]
2019
#![feature(label_break_value)]

library/alloc/src/ffi/c_str.rs

-78
Original file line numberDiff line numberDiff line change
@@ -1053,84 +1053,6 @@ impl AsRef<CStr> for CString {
10531053
}
10541054
}
10551055

1056-
#[cfg(bootstrap)]
1057-
#[doc(hidden)]
1058-
#[unstable(feature = "cstr_internals", issue = "none")]
1059-
pub trait CStrExt {
1060-
/// Converts a `CStr` into a <code>[Cow]<[str]></code>.
1061-
///
1062-
/// If the contents of the `CStr` are valid UTF-8 data, this
1063-
/// function will return a <code>[Cow]::[Borrowed]\(&[str])</code>
1064-
/// with the corresponding <code>&[str]</code> slice. Otherwise, it will
1065-
/// replace any invalid UTF-8 sequences with
1066-
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
1067-
/// <code>[Cow]::[Owned]\(&[str])</code> with the result.
1068-
///
1069-
/// [str]: prim@str "str"
1070-
/// [Borrowed]: Cow::Borrowed
1071-
/// [Owned]: Cow::Owned
1072-
/// [U+FFFD]: crate::char::REPLACEMENT_CHARACTER "std::char::REPLACEMENT_CHARACTER"
1073-
///
1074-
/// # Examples
1075-
///
1076-
/// Calling `to_string_lossy` on a `CStr` containing valid UTF-8:
1077-
///
1078-
/// ```
1079-
/// use std::borrow::Cow;
1080-
/// use std::ffi::CStr;
1081-
///
1082-
/// let cstr = CStr::from_bytes_with_nul(b"Hello World\0")
1083-
/// .expect("CStr::from_bytes_with_nul failed");
1084-
/// assert_eq!(cstr.to_string_lossy(), Cow::Borrowed("Hello World"));
1085-
/// ```
1086-
///
1087-
/// Calling `to_string_lossy` on a `CStr` containing invalid UTF-8:
1088-
///
1089-
/// ```
1090-
/// use std::borrow::Cow;
1091-
/// use std::ffi::CStr;
1092-
///
1093-
/// let cstr = CStr::from_bytes_with_nul(b"Hello \xF0\x90\x80World\0")
1094-
/// .expect("CStr::from_bytes_with_nul failed");
1095-
/// assert_eq!(
1096-
/// cstr.to_string_lossy(),
1097-
/// Cow::Owned(String::from("Hello �World")) as Cow<'_, str>
1098-
/// );
1099-
/// ```
1100-
#[must_use = "this returns the result of the operation, \
1101-
without modifying the original"]
1102-
#[stable(feature = "cstr_to_str", since = "1.4.0")]
1103-
fn to_string_lossy(&self) -> Cow<'_, str>;
1104-
1105-
/// Converts a <code>[Box]<[CStr]></code> into a [`CString`] without copying or allocating.
1106-
///
1107-
/// # Examples
1108-
///
1109-
/// ```
1110-
/// use std::ffi::CString;
1111-
///
1112-
/// let c_string = CString::new(b"foo".to_vec()).expect("CString::new failed");
1113-
/// let boxed = c_string.into_boxed_c_str();
1114-
/// assert_eq!(boxed.into_c_string(), CString::new("foo").expect("CString::new failed"));
1115-
/// ```
1116-
#[must_use = "`self` will be dropped if the result is not used"]
1117-
#[stable(feature = "into_boxed_c_str", since = "1.20.0")]
1118-
fn into_c_string(self: Box<Self>) -> CString;
1119-
}
1120-
1121-
#[cfg(bootstrap)]
1122-
#[unstable(feature = "cstr_internals", issue = "none")]
1123-
impl CStrExt for CStr {
1124-
fn to_string_lossy(&self) -> Cow<'_, str> {
1125-
String::from_utf8_lossy(self.to_bytes())
1126-
}
1127-
1128-
fn into_c_string(self: Box<Self>) -> CString {
1129-
CString::from(self)
1130-
}
1131-
}
1132-
1133-
#[cfg(not(bootstrap))]
11341056
#[cfg(not(test))]
11351057
impl CStr {
11361058
/// Converts a `CStr` into a <code>[Cow]<[str]></code>.

library/alloc/src/ffi/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@
8080
8181
#![unstable(feature = "alloc_ffi", issue = "94079")]
8282

83-
#[cfg(bootstrap)]
84-
#[unstable(feature = "cstr_internals", issue = "none")]
85-
pub use self::c_str::CStrExt;
8683
#[unstable(feature = "alloc_c_string", issue = "94079")]
8784
pub use self::c_str::FromVecWithNulError;
8885
#[unstable(feature = "alloc_c_string", issue = "94079")]

library/alloc/src/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ macro_rules! vec {
5656
// `slice::into_vec` function which is only available with cfg(test)
5757
// NB see the slice::hack module in slice.rs for more information
5858
#[cfg(all(not(no_global_oom_handling), test))]
59-
#[cfg_attr(not(bootstrap), allow(unused_macro_rules))]
59+
#[allow(unused_macro_rules)]
6060
macro_rules! vec {
6161
() => (
6262
$crate::vec::Vec::new()

library/core/src/ffi/c_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use crate::str;
7777
#[derive(Hash)]
7878
#[cfg_attr(not(test), rustc_diagnostic_item = "CStr")]
7979
#[unstable(feature = "core_c_str", issue = "94079")]
80-
#[cfg_attr(not(bootstrap), rustc_has_incoherent_inherent_impls)]
80+
#[rustc_has_incoherent_inherent_impls]
8181
// FIXME:
8282
// `fn from` in `impl From<&CStr> for Box<CStr>` current implementation relies
8383
// on `CStr` being layout-compatible with `[u8]`.

library/core/src/intrinsics.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1908,7 +1908,6 @@ extern "rust-intrinsic" {
19081908

19091909
/// See documentation of `<*const T>::sub_ptr` for details.
19101910
#[rustc_const_unstable(feature = "const_ptr_offset_from", issue = "92980")]
1911-
#[cfg(not(bootstrap))]
19121911
pub fn ptr_offset_from_unsigned<T>(ptr: *const T, base: *const T) -> usize;
19131912

19141913
/// See documentation of `<*const T>::guaranteed_eq` for details.
@@ -2393,11 +2392,3 @@ where
23932392
{
23942393
called_in_const.call_once(arg)
23952394
}
2396-
2397-
/// Bootstrap polyfill
2398-
#[cfg(bootstrap)]
2399-
pub const unsafe fn ptr_offset_from_unsigned<T>(ptr: *const T, base: *const T) -> usize {
2400-
// SAFETY: we have stricter preconditions than `ptr_offset_from`, so can
2401-
// call it, and its output has to be positive, so we can just cast.
2402-
unsafe { ptr_offset_from(ptr, base) as _ }
2403-
}

library/core/src/ops/try_trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ pub trait FromResidual<R = <Self as Try>::Residual> {
330330
fn from_residual(residual: R) -> Self;
331331
}
332332

333-
#[cfg(not(bootstrap))]
334333
#[unstable(
335334
feature = "yeet_desugar_details",
336335
issue = "none",

library/portable-simd/crates/core_simd/src/intrinsics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ extern "platform-intrinsic" {
6262
pub(crate) fn simd_xor<T>(x: T, y: T) -> T;
6363

6464
/// getelementptr (without inbounds)
65-
#[cfg(not(bootstrap))]
6665
pub(crate) fn simd_arith_offset<T, U>(ptrs: T, offsets: U) -> T;
6766

6867
/// fptoui/fptosi/uitofp/sitofp

library/portable-simd/crates/core_simd/src/vector/ptr.rs

-19
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
//! Private implementation details of public gather/scatter APIs.
2-
#[cfg(not(bootstrap))]
32
use crate::simd::intrinsics;
43
use crate::simd::{LaneCount, Simd, SupportedLaneCount};
5-
#[cfg(bootstrap)]
6-
use core::mem;
74

85
/// A vector of *const T.
96
#[derive(Debug, Copy, Clone)]
@@ -24,14 +21,6 @@ where
2421
#[inline]
2522
#[must_use]
2623
pub fn wrapping_add(self, addend: Simd<usize, LANES>) -> Self {
27-
#[cfg(bootstrap)]
28-
// Safety: converting pointers to usize and vice-versa is safe
29-
// (even if using that pointer is not)
30-
unsafe {
31-
let x: Simd<usize, LANES> = mem::transmute_copy(&self);
32-
mem::transmute_copy(&{ x + (addend * Simd::splat(mem::size_of::<T>())) })
33-
}
34-
#[cfg(not(bootstrap))]
3524
// Safety: this intrinsic doesn't have a precondition
3625
unsafe { intrinsics::simd_arith_offset(self, addend) }
3726
}
@@ -56,14 +45,6 @@ where
5645
#[inline]
5746
#[must_use]
5847
pub fn wrapping_add(self, addend: Simd<usize, LANES>) -> Self {
59-
#[cfg(bootstrap)]
60-
// Safety: converting pointers to usize and vice-versa is safe
61-
// (even if using that pointer is not)
62-
unsafe {
63-
let x: Simd<usize, LANES> = mem::transmute_copy(&self);
64-
mem::transmute_copy(&{ x + (addend * Simd::splat(mem::size_of::<T>())) })
65-
}
66-
#[cfg(not(bootstrap))]
6748
// Safety: this intrinsic doesn't have a precondition
6849
unsafe { intrinsics::simd_arith_offset(self, addend) }
6950
}

library/std/src/prelude/v1.rs

-4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,3 @@ pub use crate::string::{String, ToString};
9595
#[stable(feature = "rust1", since = "1.0.0")]
9696
#[doc(no_inline)]
9797
pub use crate::vec::Vec;
98-
99-
#[cfg(bootstrap)]
100-
#[unstable(feature = "cstr_internals", issue = "none")]
101-
pub use alloc::ffi::CStrExt;

src/bootstrap/builder.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1440,9 +1440,7 @@ impl<'a> Builder<'a> {
14401440
},
14411441
);
14421442

1443-
// FIXME(davidtwco): #[cfg(not(bootstrap))] - #95612 needs to be in the bootstrap compiler
1444-
// for this conditional to be removed.
1445-
if !target.contains("windows") || compiler.stage >= 1 {
1443+
if !target.contains("windows") {
14461444
let needs_unstable_opts = target.contains("linux")
14471445
|| target.contains("windows")
14481446
|| target.contains("bsd")

0 commit comments

Comments
 (0)