about summary refs log tree commit diff
path: root/src/bootstrap/compile.rs
diff options
context:
space:
mode:
authorozkanonur <work@onurozkan.dev>2023-05-07 00:12:29 +0300
committerozkanonur <work@onurozkan.dev>2023-05-07 00:12:29 +0300
commit4e7c14fe9f03dd0189f954bd9cb97c3c513e7eed (patch)
treefa8a777bab81cc492a0df4d8bd6d40efc17d2ae4 /src/bootstrap/compile.rs
parent8b8110e1469d459a196f6feb60d82dec48c3cfc2 (diff)
downloadrust-4e7c14fe9f03dd0189f954bd9cb97c3c513e7eed.tar.gz
rust-4e7c14fe9f03dd0189f954bd9cb97c3c513e7eed.zip
enable `rust_2018_idioms` for doctests
Signed-off-by: ozkanonur <work@onurozkan.dev>
Diffstat (limited to 'src/bootstrap/compile.rs')
-rw-r--r--src/bootstrap/compile.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 7d2a6862500..1de9f592a27 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -412,6 +412,8 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
         format!("-Zcrate-attr=doc(html_root_url=\"{}/\")", builder.doc_rust_lang_org_channel(),);
     cargo.rustflag(&html_root);
     cargo.rustdocflag(&html_root);
+
+    cargo.rustdocflag("-Zcrate-attr=warn(rust_2018_idioms)");
 }
 
 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
@@ -810,6 +812,9 @@ pub fn rustc_cargo(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetSelec
         .arg(builder.rustc_features(builder.kind))
         .arg("--manifest-path")
         .arg(builder.src.join("compiler/rustc/Cargo.toml"));
+
+    cargo.rustdocflag("-Zcrate-attr=warn(rust_2018_idioms)");
+
     rustc_cargo_env(builder, cargo, target, stage);
 }