Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2309,10 +2309,10 @@ declare_lint! {
/// ### Example
///
/// ```rust
/// #![feature(sanitize)]
/// #![cfg_attr(not(bootstrap), feature(sanitize))]
///
/// #[inline(always)]
/// #[sanitize(address = "off")]
/// #[cfg_attr(not(bootstrap), sanitize(address = "off"))]
/// fn x() {}
///
/// fn main() {
Expand Down Expand Up @@ -4832,13 +4832,16 @@ declare_lint! {
///
/// ### Example
///
/// ```rust,compile_fail
#[cfg_attr(not(bootstrap), doc = "```rust,compile_fail")]
#[cfg_attr(bootstrap, doc = "```rust")]
/// #![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
Comment on lines +4842 to +4844
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is this because we run doctests on rustc_lint_defs with a build compiler, which could be a stage 0 rustc which happens to be a beta rustc?

Would this be broken under local-rebuild if the build compiler happens to be the in-tree compiler that e.g. would know about feature(sanitize)? Or is that not a supported configuration for this particular case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think that we can remove this now, because in the latest commit I skipped the lint-docs tests in stage 1, and running them with explicit --stage 1 runs into other failures anyway. I'll try to remove it and see what CI says.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. Because this dual gating was a bit surprising to see.

///
/// {{produces}}
///
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::core::build_steps::compile::{
};
use crate::core::build_steps::tool;
use crate::core::build_steps::tool::{
COMPILETEST_ALLOW_FEATURES, SourceType, ToolTargetBuildMode, get_tool_target_compiler,
prepare_tool_cargo,
COMPILETEST_ALLOW_FEATURES, SourceType, TEST_FLOAT_PARSE_ALLOW_FEATURES, ToolTargetBuildMode,
get_tool_target_compiler, prepare_tool_cargo,
};
use crate::core::builder::{
self, Alias, Builder, Cargo, Kind, RunConfig, ShouldRun, Step, StepMetadata, crate_description,
Expand Down Expand Up @@ -791,7 +791,7 @@ tool_check_step!(MiroptTestTools {
tool_check_step!(TestFloatParse {
path: "src/tools/test-float-parse",
mode: |_builder| Mode::ToolStd,
allow_features: tool::TestFloatParse::ALLOW_FEATURES
allow_features: TEST_FLOAT_PARSE_ALLOW_FEATURES
});
tool_check_step!(FeaturesStatusDump {
path: "src/tools/features-status-dump",
Expand Down
8 changes: 7 additions & 1 deletion src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,11 @@ fn doc_std(
}

/// Prepare a compiler that will be able to document something for `target` at `stage`.
fn prepare_doc_compiler(builder: &Builder<'_>, target: TargetSelection, stage: u32) -> Compiler {
pub fn prepare_doc_compiler(
builder: &Builder<'_>,
target: TargetSelection,
stage: u32,
) -> Compiler {
assert!(stage > 0, "Cannot document anything in stage 0");
let build_compiler = builder.compiler(stage - 1, builder.host_target);
builder.std(build_compiler, target);
Expand Down Expand Up @@ -1289,6 +1293,8 @@ impl Step for RustcBook {
// functional sysroot.
builder.std(self.build_compiler, self.target);
let mut cmd = builder.tool_cmd(Tool::LintDocs);
cmd.arg("--build-rustc-stage");
cmd.arg(self.build_compiler.stage.to_string());
cmd.arg("--src");
cmd.arg(builder.src.join("compiler"));
cmd.arg("--out");
Expand Down
Loading
Loading