Skip to content

Commit

Permalink
Merge pull request #246 from llogiq/edition-config-default
Browse files Browse the repository at this point in the history
add optional default edition to `Config`
  • Loading branch information
Manishearth authored Oct 20, 2021
2 parents e3603df + c41ebe9 commit 86508a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ pub struct Config {
/// created in `/<build_base>/rustfix_missing_coverage.txt`
pub rustfix_coverage: bool,

/// The default Rust edition
pub edition: Option<String>,

// Configuration for various run-make tests frobbing things like C compilers
// or querying about various LLVM component information.
pub cc: String,
Expand Down Expand Up @@ -416,6 +419,7 @@ impl Default for Config {
llvm_components: "llvm-components".to_string(),
llvm_cxxflags: "llvm-cxxflags".to_string(),
nodejs: None,
edition: None,
}
}
}
2 changes: 1 addition & 1 deletion src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ impl Config {
}

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

Expand Down

0 comments on commit 86508a6

Please sign in to comment.