Skip to content

Commit 36cf385

Browse files
committed
Ensure Rustc::print use in rmake tests
1 parent 1ca959e commit 36cf385

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

tests/run-make/print-cfg/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//! It also checks that some targets have the correct set cfgs.
77
88
use std::collections::HashSet;
9-
use std::ffi::OsString;
109
use std::iter::FromIterator;
1110
use std::path::PathBuf;
1211

@@ -91,10 +90,8 @@ fn check(PrintCfg { target, includes, disallow }: PrintCfg) {
9190
// --print=cfg=PATH
9291
{
9392
let tmp_path = PathBuf::from(format!("{target}.cfg"));
94-
let mut print_arg = OsString::from("--print=cfg=");
95-
print_arg.push(tmp_path.as_os_str());
9693

97-
rustc().target(target).arg(print_arg).run();
94+
rustc().target(target).print(&format!("cfg={}", tmp_path.display())).run();
9895

9996
let output = rfs::read_to_string(&tmp_path);
10097

tests/run-make/print-check-cfg/rmake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn main() {
8787

8888
fn check(CheckCfg { args, contains }: CheckCfg) {
8989
let output =
90-
rustc().input("lib.rs").arg("-Zunstable-options").arg("--print=check-cfg").args(args).run();
90+
rustc().input("lib.rs").arg("-Zunstable-options").print("check-cfg").args(args).run();
9191

9292
let stdout = output.stdout_utf8();
9393

tests/run-make/print-to-output/rmake.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! This checks the output of some `--print` options when
22
//! output to a file (instead of stdout)
33
4-
use std::ffi::OsString;
54
use std::path::PathBuf;
65

76
use run_make_support::{rfs, rustc, target};
@@ -44,10 +43,8 @@ fn check(args: Option) {
4443
// --print={option}=PATH
4544
let output = {
4645
let tmp_path = PathBuf::from(format!("{}.txt", args.option));
47-
let mut print_arg = OsString::from(format!("--print={}=", args.option));
48-
print_arg.push(tmp_path.as_os_str());
4946

50-
rustc().target(args.target).arg(print_arg).run();
47+
rustc().target(args.target).print(&format!("{}={}", args.option, tmp_path.display())).run();
5148

5249
rfs::read_to_string(&tmp_path)
5350
};

tests/run-make/rustdoc-scrape-examples-macros/rmake.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ fn main() {
1111
let dylib_name = rustc()
1212
.crate_name(proc_crate_name)
1313
.crate_type("dylib")
14-
.arg("--print")
15-
.arg("file-names")
14+
.print("file-names")
1615
.arg("-")
1716
.run()
1817
.stdout_utf8();

0 commit comments

Comments
 (0)