Skip to content

Commit 53232e5

Browse files
authored
Rollup merge of #50117 - pnkfelix:fix-issue-50113, r=oli-obk
must explicitly request file name when using with_file_name. Fix #50113
2 parents 4ede038 + 042e1e0 commit 53232e5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tools/compiletest/src/runtest.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -2880,8 +2880,10 @@ impl<'test> TestCx<'test> {
28802880
}
28812881
}
28822882

2883-
let expected_output_path = self.expected_output_path(kind);
2884-
let output_file = self.output_base_name().with_file_name(&expected_output_path);
2883+
let expected_output = self.expected_output_path(kind);
2884+
// #50113: output is abspath; only want filename component.
2885+
let expected_output = expected_output.file_name().expect("output path requires file name");
2886+
let output_file = self.output_base_name().with_file_name(&expected_output);
28852887
match File::create(&output_file).and_then(|mut f| f.write_all(actual.as_bytes())) {
28862888
Ok(()) => {}
28872889
Err(e) => self.fatal(&format!(

0 commit comments

Comments
 (0)