We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dddd872 commit b9e4174Copy full SHA for b9e4174
src/bootstrap/format.rs
@@ -37,8 +37,13 @@ pub fn format(build: &Build, check: bool) {
37
builder.add_defaults();
38
builder.select("rust");
39
let matcher = builder.build().unwrap();
40
-
41
- let rustfmt_config = t!(std::fs::read_to_string(build.src.join("rustfmt.toml")));
+ let rustfmt_config = build.src.join("rustfmt.toml");
+ if !rustfmt_config.exists() {
42
+ eprintln!("Not running formatting checks; rustfmt.toml does not exist.");
43
+ eprintln!("This may happen in distributed tarballs.");
44
+ return;
45
+ }
46
+ let rustfmt_config = t!(std::fs::read_to_string(&rustfmt_config));
47
let rustfmt_config: RustfmtConfig = t!(toml::from_str(&rustfmt_config));
48
let mut ignore_fmt = ignore::overrides::OverrideBuilder::new(&build.src);
49
for ignore in rustfmt_config.ignore {
0 commit comments