Skip to content

Commit df0caf7

Browse files
committed
implement easiest review suggestions
1 parent c16ad5e commit df0caf7

File tree

1 file changed

+4
-5
lines changed
  • tests/run-make/pgo-branch-weights

1 file changed

+4
-5
lines changed

tests/run-make/pgo-branch-weights/rmake.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@
1414
//@ ignore-windows-gnu
1515
//@ ignore-cross-compile
1616

17-
use run_make_support::{llvm_profdata, rustc, rustdoc, tmp_dir};
17+
use run_make_support::{llvm_profdata, rustc, rustdoc, target, tmp_dir};
1818
use std::io::{self, Write};
1919
use std::process::Command;
2020

2121
fn main() {
2222
// For some very small programs GNU ld seems to not properly handle
2323
// instrumentation sections correctly. Neither Gold nor LLD have that
2424
// problem.
25-
let common_flags = if env::consts::OS == "linux"
26-
&& env::var("TARGET").unwrap_or_default().contains("x86") {
27-
"-Clink-args=-fuse-ld=gold" // FIXME, Why was there a comma at the start?
25+
let common_flags = if cfg!(target_os = "linux") && target().contains("x86") {
26+
"-Clink-args=-fuse-ld=gold"
2827
} else {
2928
""
3029
};
3130
let path_prof_data_dir = tmp_dir().join("prof_data_dir");
32-
let path_merged_profdata = path_prof_data_dir.clone().join("merged.profdata");
31+
let path_merged_profdata = path_prof_data_dir.join("merged.profdata");
3332
rustc().arg(common_flags).input("opaque.rs").run();
3433
fs::create_dir_all(&path_prof_data_dir);
3534
rustc().arg(common_flags)

0 commit comments

Comments
 (0)