diff --git a/src/build_helper/Cargo.toml b/src/build_helper/Cargo.toml
index 01d704f816bbc..04c7820b45665 100644
--- a/src/build_helper/Cargo.toml
+++ b/src/build_helper/Cargo.toml
@@ -2,6 +2,7 @@
 name = "build_helper"
 version = "0.1.0"
 authors = ["The Rust Project Developers"]
+edition = "2018"
 
 [lib]
 name = "build_helper"
diff --git a/src/build_helper/lib.rs b/src/build_helper/lib.rs
index c66c5c9249087..93aa91768121c 100644
--- a/src/build_helper/lib.rs
+++ b/src/build_helper/lib.rs
@@ -1,3 +1,5 @@
+#![deny(rust_2018_idioms)]
+
 use std::fs::File;
 use std::path::{Path, PathBuf};
 use std::process::{Command, Stdio};