Skip to content

Commit 86508a6

Browse files
authored
Merge pull request #246 from llogiq/edition-config-default
add optional default edition to `Config`
2 parents e3603df + c41ebe9 commit 86508a6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/common.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ pub struct Config {
226226
/// created in `/<build_base>/rustfix_missing_coverage.txt`
227227
pub rustfix_coverage: bool,
228228

229+
/// The default Rust edition
230+
pub edition: Option<String>,
231+
229232
// Configuration for various run-make tests frobbing things like C compilers
230233
// or querying about various LLVM component information.
231234
pub cc: String,
@@ -416,6 +419,7 @@ impl Default for Config {
416419
llvm_components: "llvm-components".to_string(),
417420
llvm_cxxflags: "llvm-cxxflags".to_string(),
418421
nodejs: None,
422+
edition: None,
419423
}
420424
}
421425
}

src/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ impl Config {
627627
}
628628

629629
fn parse_edition(&self, line: &str) -> Option<String> {
630-
self.parse_name_value_directive(line, "edition")
630+
self.parse_name_value_directive(line, "edition").or_else(|| self.edition.clone())
631631
}
632632
}
633633

0 commit comments

Comments
 (0)