Skip to content

Commit

Permalink
Remove duplicated usage of -Zunstable-options in bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 19, 2024
1 parent 45fbf41 commit 7bfb009
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
2 changes: 0 additions & 2 deletions src/bootstrap/src/bin/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ fn main() {
if stage == "0" {
cmd.arg("--cfg=bootstrap");
}
cmd.arg("-Zunstable-options");
cmd.arg("--check-cfg=cfg(bootstrap)");

maybe_dump(format!("stage{stage}-rustdoc"), &cmd);

Expand Down
15 changes: 3 additions & 12 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,11 @@ fn invoke_rustdoc(
.arg(&out)
.arg(&path)
.arg("--markdown-css")
.arg("../rust.css");
.arg("../rust.css")
.arg("-Zunstable-options");

if !builder.config.docs_minification {
cmd.arg("-Z").arg("unstable-options").arg("--disable-minification");
cmd.arg("--disable-minification");
}

cmd.run(builder);
Expand Down Expand Up @@ -376,8 +377,6 @@ impl Step for Standalone {
}

let mut cmd = builder.rustdoc_cmd(compiler);
// Needed for --index-page flag
cmd.arg("-Z").arg("unstable-options");

cmd.arg("--html-after-content")
.arg(&footer)
Expand Down Expand Up @@ -478,9 +477,6 @@ impl Step for Releases {
mem::drop(tmpfile);
let mut cmd = builder.rustdoc_cmd(compiler);

// Needed for --index-page flag
cmd.arg("-Z").arg("unstable-options");

cmd.arg("--html-after-content")
.arg(&footer)
.arg("--html-before-content")
Expand Down Expand Up @@ -715,8 +711,6 @@ fn doc_std(
.arg("--target-dir")
.arg(&*target_dir.to_string_lossy())
.arg("-Zskip-rustdoc-fingerprint")
.rustdocflag("-Z")
.rustdocflag("unstable-options")
.rustdocflag("--resource-suffix")
.rustdocflag(&builder.version);
for arg in extra_args {
Expand Down Expand Up @@ -822,15 +816,13 @@ impl Step for Rustc {
// Since we always pass --document-private-items, there's no need to warn about linking to private items.
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
cargo.rustdocflag("--enable-index-page");
cargo.rustdocflag("-Zunstable-options");
cargo.rustdocflag("-Znormalize-docs");
cargo.rustdocflag("--show-type-layout");
// FIXME: `--generate-link-to-definition` tries to resolve cfged out code
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// cargo.rustdocflag("--generate-link-to-definition");

compile::rustc_cargo(builder, &mut cargo, target, &compiler);
cargo.arg("-Zunstable-options");
cargo.arg("-Zskip-rustdoc-fingerprint");

// Only include compiler crates, no dependencies of those, such as `libc`.
Expand Down Expand Up @@ -986,7 +978,6 @@ macro_rules! tool_doc {
cargo.rustdocflag("-Arustdoc::private-intra-doc-links");
cargo.rustdocflag("--enable-index-page");
cargo.rustdocflag("--show-type-layout");
cargo.rustdocflag("-Zunstable-options");
// FIXME: `--generate-link-to-definition` tries to resolve cfged out code
// see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
// cargo.rustdocflag("--generate-link-to-definition");
Expand Down
13 changes: 1 addition & 12 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,6 @@ impl<'a> Builder<'a> {
rustflags.arg("-Csymbol-mangling-version=v0");
} else {
rustflags.arg("-Csymbol-mangling-version=legacy");
rustflags.arg("-Zunstable-options");
}

// Enable compile-time checking of `cfg` names, values and Cargo `features`.
Expand Down Expand Up @@ -1864,16 +1863,7 @@ impl<'a> Builder<'a> {
},
);

let split_debuginfo = self.config.split_debuginfo(target);
let split_debuginfo_is_stable = target.contains("linux")
|| target.contains("apple")
|| (target.is_msvc() && split_debuginfo == SplitDebuginfo::Packed)
|| (target.is_windows() && split_debuginfo == SplitDebuginfo::Off);

if !split_debuginfo_is_stable {
rustflags.arg("-Zunstable-options");
}
match split_debuginfo {
match self.config.split_debuginfo(target) {
SplitDebuginfo::Packed => rustflags.arg("-Csplit-debuginfo=packed"),
SplitDebuginfo::Unpacked => rustflags.arg("-Csplit-debuginfo=unpacked"),
SplitDebuginfo::Off => rustflags.arg("-Csplit-debuginfo=off"),
Expand Down Expand Up @@ -2050,7 +2040,6 @@ impl<'a> Builder<'a> {
}

if mode == Mode::Rustc {
rustflags.arg("-Zunstable-options");
rustflags.arg("-Wrustc::internal");
// FIXME(edition_2024): Change this to `-Wrust_2024_idioms` when all
// of the individual lints are satisfied.
Expand Down

0 comments on commit 7bfb009

Please sign in to comment.