diff --git a/src/common.rs b/src/common.rs index 7ab82ee..17eaa54 100644 --- a/src/common.rs +++ b/src/common.rs @@ -226,6 +226,9 @@ pub struct Config { /// created in `//rustfix_missing_coverage.txt` pub rustfix_coverage: bool, + /// The default Rust edition + pub edition: Option, + // Configuration for various run-make tests frobbing things like C compilers // or querying about various LLVM component information. pub cc: String, @@ -416,6 +419,7 @@ impl Default for Config { llvm_components: "llvm-components".to_string(), llvm_cxxflags: "llvm-cxxflags".to_string(), nodejs: None, + edition: None, } } } diff --git a/src/header.rs b/src/header.rs index c755e26..e2b95d6 100644 --- a/src/header.rs +++ b/src/header.rs @@ -627,7 +627,7 @@ impl Config { } fn parse_edition(&self, line: &str) -> Option { - self.parse_name_value_directive(line, "edition") + self.parse_name_value_directive(line, "edition").or_else(|| self.edition.clone()) } }