Skip to content

Commit 91a8496

Browse files
authored
Rollup merge of rust-lang#108404 - ozkanonur:108004, r=jyn514
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``
2 parents 94a7835 + 49516b3 commit 91a8496

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bootstrap/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
218218
WalkBuilder::new(first)
219219
}
220220
} else {
221-
WalkBuilder::new(first)
221+
WalkBuilder::new(src.join(first))
222222
};
223223

224224
for path in &paths[1..] {
@@ -229,7 +229,7 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
229229
walker.add(path);
230230
}
231231
} else {
232-
walker.add(path);
232+
walker.add(src.join(path));
233233
}
234234
}
235235

0 commit comments

Comments
 (0)