Apply cfg(bootstrap) replacement

This commit is contained in:
Mark Rousskov 2025-09-15 22:01:36 -04:00
parent 4e9716fbc5
commit 201f299ef6
13 changed files with 8 additions and 38 deletions

View file

@ -1,7 +1,6 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![allow(rustc::diagnostic_outside_of_impl)]
#![cfg_attr(bootstrap, feature(strict_overflow_ops))]
#![doc(rust_logo)]
#![feature(array_try_map)]
#![feature(assert_matches)]

View file

@ -130,12 +130,6 @@ impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeFrom<I> {
impl<I: Idx, T> IntoSliceIdx<I, [T]> for core::range::RangeInclusive<I> {
type Output = core::range::RangeInclusive<usize>;
#[inline]
#[cfg(bootstrap)]
fn into_slice_idx(self) -> Self::Output {
core::range::RangeInclusive { start: self.start.index(), end: self.end.index() }
}
#[inline]
#[cfg(not(bootstrap))]
fn into_slice_idx(self) -> Self::Output {
core::range::RangeInclusive { start: self.start.index(), last: self.last.index() }
}

View file

@ -2309,10 +2309,10 @@ declare_lint! {
/// ### Example
///
/// ```rust
/// #![cfg_attr(not(bootstrap), feature(sanitize))]
/// #![feature(sanitize)]
///
/// #[inline(always)]
/// #[cfg_attr(not(bootstrap), sanitize(address = "off"))]
/// #[sanitize(address = "off")]
/// fn x() {}
///
/// fn main() {
@ -4837,16 +4837,13 @@ declare_lint! {
///
/// ### Example
///
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
#[cfg_attr(bootstrap, doc = "```rust")]
/// ```rust,compile_fail
/// #![doc = in_root!()]
///
/// macro_rules! in_root { () => { "" } }
///
/// fn main() {}
#[cfg_attr(not(bootstrap), doc = "```")]
#[cfg_attr(bootstrap, doc = "```")]
// ^ Needed to avoid tidy warning about odd number of backticks
/// ```
///
/// {{produces}}
///

View file

@ -29,7 +29,6 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(rustc::direct_use_of_rustc_type_ir)]
#![allow(rustc::untranslatable_diagnostic)]
#![cfg_attr(bootstrap, feature(round_char_boundary))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(allocator_api)]

View file

@ -17,7 +17,6 @@
// tidy-alphabetical-start
#![allow(internal_features)]
#![cfg_attr(bootstrap, feature(round_char_boundary))]
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![doc(rust_logo)]
#![feature(array_windows)]

View file

@ -33,11 +33,7 @@ pub struct Finder {
//
// Targets can be removed from this list once they are present in the stage0 compiler (usually by updating the beta compiler of the bootstrap).
const STAGE0_MISSING_TARGETS: &[&str] = &[
"armv7a-vex-v5",
"riscv64a23-unknown-linux-gnu",
// just a dummy comment so the list doesn't get onelined
"aarch64_be-unknown-hermit",
"aarch64_be-unknown-none-softfloat",
"x86_64-unknown-motor",
];

View file

@ -1,5 +1,4 @@
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(round_char_boundary))]
#![doc(
html_root_url = "https://doc.rust-lang.org/nightly/",
html_playground_url = "https://play.rust-lang.org/"

View file

@ -7,7 +7,6 @@
#![feature(iter_intersperse)]
#![feature(iter_partition_in_place)]
#![feature(never_type)]
#![cfg_attr(bootstrap, feature(round_char_boundary))]
#![feature(rustc_private)]
#![feature(stmt_expr_attributes)]
#![feature(unwrap_infallible)]

View file

@ -1,6 +1,5 @@
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(clippy::assertions_on_constants)]
#![cfg_attr(bootstrap, feature(path_file_prefix))]
use std::cmp::Ordering;
use std::ffi::OsStr;

View file

@ -1,4 +1,3 @@
#![cfg_attr(bootstrap, feature(strict_overflow_ops))]
#![feature(abort_unwind)]
#![feature(cfg_select)]
#![feature(rustc_private)]

View file

@ -9,11 +9,6 @@
// and we don't even get a regular panic; rustc aborts with a different exit code instead.
//@ignore-host: windows
// FIXME: this tests a crash in rustc. For stage1, rustc is built with the downloaded standard
// library which doesn't yet print the thread ID. Normalization can be removed at the stage bump.
// For the grep: cfg(bootstrap)
//@normalize-stderr-test: "thread 'rustc' panicked" -> "thread 'rustc' ($$TID) panicked"
#![feature(custom_mir, core_intrinsics)]
use core::intrinsics::mir::*;

View file

@ -13,13 +13,8 @@
// top of this file are present, then assume all args are present.
//@ normalize-stderr: "note: compiler flags: .*-Z ui-testing.*-Z track-diagnostics" -> "note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics"
// FIXME: this tests a crash in rustc. For stage1, rustc is built with the downloaded standard
// library which doesn't yet print the thread ID. Normalization can be removed at the stage bump.
// For the grep: cfg(bootstrap)
//@normalize-stderr: "thread 'rustc' panicked" -> "thread 'rustc' ($$TID) panicked"
fn main() {
break rust
break rust;
//~^ ERROR cannot find value `rust` in this scope
//~| NOTE created at
//~| ERROR `break` outside of a loop or labeled block

View file

@ -1,7 +1,7 @@
error[E0425]: cannot find value `rust` in this scope
--> $DIR/track.rs:LL:CC
|
LL | break rust
LL | break rust;
| ^^^^ not found in this scope
|
= note: -Ztrack-diagnostics: created at compiler/rustc_resolve/src/late/diagnostics.rs:LL:CC
@ -9,7 +9,7 @@ LL | break rust
error[E0268]: `break` outside of a loop or labeled block
--> $DIR/track.rs:LL:CC
|
LL | break rust
LL | break rust;
| ^^^^^^^^^^ cannot `break` outside of a loop or labeled block
|
= note: -Ztrack-diagnostics: created at compiler/rustc_hir_typeck/src/loops.rs:LL:CC
@ -17,7 +17,7 @@ LL | break rust
error: internal compiler error: It looks like you're trying to break rust; would you like some ICE?
--> $DIR/track.rs:LL:CC
|
LL | break rust
LL | break rust;
| ^^^^^^^^^^
|
= note: -Ztrack-diagnostics: created at compiler/rustc_hir_typeck/src/lib.rs:LL:CC