Skip to content
/ rust Public
forked from rust-lang/rust

Commit 9befcfd

Browse files
committed
Fix cross-lang-lto to not use path_file_prefix
1 parent da57f14 commit 9befcfd

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tests/run-make/cross-lang-lto/rmake.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
// -Clinker-plugin-lto.
44
// See https://github.com/rust-lang/rust/pull/50000
55

6-
#![feature(path_file_prefix)]
7-
86
use std::path::PathBuf;
97

108
use run_make_support::{
@@ -92,10 +90,17 @@ fn check_bitcode(instructions: LibBuild) {
9290
llvm_ar().extract().arg(&instructions.output).run();
9391
}
9492

95-
for object in shallow_find_files(cwd(), |path| {
96-
has_prefix(path, instructions.output.file_prefix().unwrap().to_str().unwrap())
93+
let objects = shallow_find_files(cwd(), |path| {
94+
let mut output_path = instructions.output.clone();
95+
output_path.set_extension("");
96+
has_prefix(path, output_path.file_name().unwrap().to_str().unwrap())
9797
&& has_extension(path, "o")
98-
}) {
98+
});
99+
assert!(!objects.is_empty());
100+
println!("objects: {:#?}", objects);
101+
102+
for object in objects {
103+
println!("reading bitcode: {}", object.display());
99104
// All generated object files should be LLVM bitcode files - this will fail otherwise.
100105
llvm_bcanalyzer().input(object).run();
101106
}

tests/run-make/issue-107495-archive-permissions/rmake.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
#[cfg(unix)]
2-
use run_make_support::libc;
3-
41
#[cfg(unix)]
52
use std::os::unix::fs::PermissionsExt;
63
use std::path::Path;
74

5+
#[cfg(unix)]
6+
use run_make_support::libc;
87
use run_make_support::{aux_build, rfs};
98

109
fn main() {

0 commit comments

Comments
 (0)