@@ -303,10 +303,11 @@ fn invoke_rustdoc(
303303 . arg ( & out)
304304 . arg ( & path)
305305 . arg ( "--markdown-css" )
306- . arg ( "../rust.css" ) ;
306+ . arg ( "../rust.css" )
307+ . arg ( "-Zunstable-options" ) ;
307308
308309 if !builder. config . docs_minification {
309- cmd. arg ( "-Z" ) . arg ( "unstable-options" ) . arg ( "- -disable-minification") ;
310+ cmd. arg ( "--disable-minification" ) ;
310311 }
311312
312313 cmd. run ( builder) ;
@@ -376,8 +377,6 @@ impl Step for Standalone {
376377 }
377378
378379 let mut cmd = builder. rustdoc_cmd ( compiler) ;
379- // Needed for --index-page flag
380- cmd. arg ( "-Z" ) . arg ( "unstable-options" ) ;
381380
382381 cmd. arg ( "--html-after-content" )
383382 . arg ( & footer)
@@ -386,6 +385,7 @@ impl Step for Standalone {
386385 . arg ( "--html-in-header" )
387386 . arg ( & favicon)
388387 . arg ( "--markdown-no-toc" )
388+ . arg ( "-Zunstable-options" )
389389 . arg ( "--index-page" )
390390 . arg ( builder. src . join ( "src/doc/index.md" ) )
391391 . arg ( "--markdown-playground-url" )
@@ -478,9 +478,6 @@ impl Step for Releases {
478478 mem:: drop ( tmpfile) ;
479479 let mut cmd = builder. rustdoc_cmd ( compiler) ;
480480
481- // Needed for --index-page flag
482- cmd. arg ( "-Z" ) . arg ( "unstable-options" ) ;
483-
484481 cmd. arg ( "--html-after-content" )
485482 . arg ( & footer)
486483 . arg ( "--html-before-content" )
@@ -490,6 +487,7 @@ impl Step for Releases {
490487 . arg ( "--markdown-no-toc" )
491488 . arg ( "--markdown-css" )
492489 . arg ( "rust.css" )
490+ . arg ( "-Zunstable-options" )
493491 . arg ( "--index-page" )
494492 . arg ( builder. src . join ( "src/doc/index.md" ) )
495493 . arg ( "--markdown-playground-url" )
@@ -636,6 +634,8 @@ impl Step for Std {
636634 if !builder. config . docs_minification {
637635 extra_args. push ( "--disable-minification" ) ;
638636 }
637+ // For `--index-page` and `--output-format=json`.
638+ extra_args. push ( "-Zunstable-options" ) ;
639639
640640 doc_std ( builder, self . format , stage, target, & out, & extra_args, & crates) ;
641641
@@ -715,8 +715,6 @@ fn doc_std(
715715 . arg ( "--target-dir" )
716716 . arg ( & * target_dir. to_string_lossy ( ) )
717717 . arg ( "-Zskip-rustdoc-fingerprint" )
718- . rustdocflag ( "-Z" )
719- . rustdocflag ( "unstable-options" )
720718 . rustdocflag ( "--resource-suffix" )
721719 . rustdocflag ( & builder. version ) ;
722720 for arg in extra_args {
@@ -822,15 +820,13 @@ impl Step for Rustc {
822820 // Since we always pass --document-private-items, there's no need to warn about linking to private items.
823821 cargo. rustdocflag ( "-Arustdoc::private-intra-doc-links" ) ;
824822 cargo. rustdocflag ( "--enable-index-page" ) ;
825- cargo. rustdocflag ( "-Zunstable-options" ) ;
826823 cargo. rustdocflag ( "-Znormalize-docs" ) ;
827824 cargo. rustdocflag ( "--show-type-layout" ) ;
828825 // FIXME: `--generate-link-to-definition` tries to resolve cfged out code
829826 // see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
830827 // cargo.rustdocflag("--generate-link-to-definition");
831828
832829 compile:: rustc_cargo ( builder, & mut cargo, target, & compiler) ;
833- cargo. arg ( "-Zunstable-options" ) ;
834830 cargo. arg ( "-Zskip-rustdoc-fingerprint" ) ;
835831
836832 // Only include compiler crates, no dependencies of those, such as `libc`.
@@ -986,7 +982,6 @@ macro_rules! tool_doc {
986982 cargo. rustdocflag( "-Arustdoc::private-intra-doc-links" ) ;
987983 cargo. rustdocflag( "--enable-index-page" ) ;
988984 cargo. rustdocflag( "--show-type-layout" ) ;
989- cargo. rustdocflag( "-Zunstable-options" ) ;
990985 // FIXME: `--generate-link-to-definition` tries to resolve cfged out code
991986 // see https://github.com/rust-lang/rust/pull/122066#issuecomment-1983049222
992987 // cargo.rustdocflag("--generate-link-to-definition");
0 commit comments