Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 828e45a

Browse files
committed
Auto merge of #145663 - Kobzol:bootstrap-test, r=jieyouxu
Enforce in bootstrap that test must have stage at least 1 (except for compiletest) This PR cleans up a bunch of test steps and adds metadata to them. I didn't yet touch the most complicated step (`CompileTest`), I'm leaving that for another PR. Testing anything on stage 0 is only possible for compiletest and with `build.allow-compiletest-stage0`. Testing anything else on stage 0 will either produce a nice error or crash with a stage being subtracted below zero. r? `@jieyouxu` try-job: dist-x86_64-linux try-job: aarch64-gnu try-job: arm-android try-job: `x86_64-gnu-llvm-20*` try-job: `x86_64-msvc-*` try-job: aarch64-apple try-job: test-various
2 parents 07d246f + 5bc9308 commit 828e45a

File tree

13 files changed

+760
-384
lines changed

13 files changed

+760
-384
lines changed

‎compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,10 +2309,10 @@ declare_lint! {
23092309
/// ### Example
23102310
///
23112311
/// ```rust
2312-
/// #![feature(sanitize)]
2312+
/// #![cfg_attr(not(bootstrap), feature(sanitize))]
23132313
///
23142314
/// #[inline(always)]
2315-
/// #[sanitize(address = "off")]
2315+
/// #[cfg_attr(not(bootstrap), sanitize(address = "off"))]
23162316
/// fn x() {}
23172317
///
23182318
/// fn main() {
@@ -4832,13 +4832,16 @@ declare_lint! {
48324832
///
48334833
/// ### Example
48344834
///
4835-
/// ```rust,compile_fail
4835+
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
4836+
#[cfg_attr(bootstrap, doc = "```rust")]
48364837
/// #![doc = in_root!()]
48374838
///
48384839
/// macro_rules! in_root { () => { "" } }
48394840
///
48404841
/// fn main() {}
4841-
/// ```
4842+
#[cfg_attr(not(bootstrap), doc = "```")]
4843+
#[cfg_attr(bootstrap, doc = "```")]
4844+
// ^ Needed to avoid tidy warning about odd number of backticks
48424845
///
48434846
/// {{produces}}
48444847
///

‎src/bootstrap/src/core/build_steps/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ use crate::core::build_steps::compile::{
88
};
99
use crate::core::build_steps::tool;
1010
use crate::core::build_steps::tool::{
11-
COMPILETEST_ALLOW_FEATURES, SourceType, ToolTargetBuildMode, get_tool_target_compiler,
12-
prepare_tool_cargo,
11+
COMPILETEST_ALLOW_FEATURES, SourceType, TEST_FLOAT_PARSE_ALLOW_FEATURES,ToolTargetBuildMode,
12+
get_tool_target_compiler,prepare_tool_cargo,
1313
};
1414
use crate::core::builder::{
1515
self, Alias, Builder, Cargo, Kind, RunConfig, ShouldRun, Step, StepMetadata, crate_description,
@@ -791,7 +791,7 @@ tool_check_step!(MiroptTestTools {
791791
tool_check_step!(TestFloatParse {
792792
path: "src/tools/test-float-parse",
793793
mode: |_builder| Mode::ToolStd,
794-
allow_features: tool::TestFloatParse::ALLOW_FEATURES
794+
allow_features: TEST_FLOAT_PARSE_ALLOW_FEATURES
795795
});
796796
tool_check_step!(FeaturesStatusDump {
797797
path: "src/tools/features-status-dump",

‎src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,11 @@ fn doc_std(
791791
}
792792

793793
/// Prepare a compiler that will be able to document something for `target` at `stage`.
794-
fn prepare_doc_compiler(builder: &Builder<'_>, target: TargetSelection, stage: u32) -> Compiler {
794+
pub fn prepare_doc_compiler(
795+
builder: &Builder<'_>,
796+
target: TargetSelection,
797+
stage: u32,
798+
) -> Compiler {
795799
assert!(stage > 0, "Cannot document anything in stage 0");
796800
let build_compiler = builder.compiler(stage - 1, builder.host_target);
797801
builder.std(build_compiler, target);
@@ -1289,6 +1293,8 @@ impl Step for RustcBook {
12891293
// functional sysroot.
12901294
builder.std(self.build_compiler, self.target);
12911295
let mut cmd = builder.tool_cmd(Tool::LintDocs);
1296+
cmd.arg("--build-rustc-stage");
1297+
cmd.arg(self.build_compiler.stage.to_string());
12921298
cmd.arg("--src");
12931299
cmd.arg(builder.src.join("compiler"));
12941300
cmd.arg("--out");

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /