@@ -726,8 +726,10 @@ impl<'a> Builder<'a> {
726
726
. env ( "RUSTDOC_REAL" , self . rustdoc ( compiler) )
727
727
. env ( "RUSTDOC_CRATE_VERSION" , self . rust_version ( ) )
728
728
. env ( "RUSTC_BOOTSTRAP" , "1" )
729
- . arg ( "--deny" )
730
- . arg ( "invalid_codeblock_attribute" ) ;
729
+ . arg ( "-Dinvalid_codeblock_attribute" ) ;
730
+ if self . config . deny_warnings {
731
+ cmd. arg ( "-Dwarnings" ) ;
732
+ }
731
733
732
734
// Remove make-related flags that can cause jobserver problems.
733
735
cmd. env_remove ( "MAKEFLAGS" ) ;
@@ -841,7 +843,6 @@ impl<'a> Builder<'a> {
841
843
// but this breaks CI. At the very least, stage0 `rustdoc` needs `--cfg bootstrap`. See
842
844
// #71458.
843
845
let mut rustdocflags = rustflags. clone ( ) ;
844
- rustdocflags. arg ( "--deny" ) . arg ( "invalid_codeblock_attribute" ) ;
845
846
846
847
if let Ok ( s) = env:: var ( "CARGOFLAGS" ) {
847
848
cargo. args ( s. split_whitespace ( ) ) ;
@@ -1160,6 +1161,8 @@ impl<'a> Builder<'a> {
1160
1161
// are always ignored in dependencies. Eventually this should be
1161
1162
// fixed via better support from Cargo.
1162
1163
cargo. env ( "RUSTC_LINT_FLAGS" , lint_flags. join ( " " ) ) ;
1164
+
1165
+ rustdocflags. arg ( "-Dinvalid_codeblock_attribute" ) ;
1163
1166
}
1164
1167
1165
1168
if let Mode :: Rustc | Mode :: Codegen = mode {
0 commit comments