Skip to content

Commit

Permalink
Rollup merge of rust-lang#108404 - ozkanonur:108004, r=jyn514
Browse files Browse the repository at this point in the history
support `x fmt` for sub and outside of rust directories

This PR makes `x fmt` to be succesfully work from sub or outside dir of rust.

The following cases are tested and the results were successful.
```sh
# from rust/library directory
../x fmt compiler --check
../x fmt compiler/rustc

# from outside of rust directory
../../rust/x fmt library/std library/core --check
../../rust/x fmt library/std
```

Resolves rust-lang#108004

r? `@albertlarsan68`
  • Loading branch information
matthiaskrgr committed Feb 24, 2023
2 parents c1c0527 + 49516b3 commit dcaa764
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bootstrap/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
WalkBuilder::new(first)
}
} else {
WalkBuilder::new(first)
WalkBuilder::new(src.join(first))
};

for path in &paths[1..] {
Expand All @@ -229,7 +229,7 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
walker.add(path);
}
} else {
walker.add(path);
walker.add(src.join(path));
}
}

Expand Down

0 comments on commit dcaa764

Please sign in to comment.