Skip to content

Commit b24f68f

Browse files
committed
move hir-tree to rmake
1 parent 9ce37dc commit b24f68f

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

src/tools/run-make-support/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::env;
2+
use std::ffi::OsStr;
23
use std::path::{Path, PathBuf};
34
use std::process::{Command, Output};
4-
55
pub use wasmparser;
66

77
pub fn out_dir() -> PathBuf {
@@ -43,7 +43,7 @@ impl RustcInvocationBuilder {
4343
Self { cmd }
4444
}
4545

46-
pub fn arg(&mut self, arg: &str) -> &mut RustcInvocationBuilder {
46+
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut RustcInvocationBuilder {
4747
self.cmd.arg(arg);
4848
self
4949
}

tests/run-make/hir-tree/Makefile

-8
This file was deleted.

tests/run-make/hir-tree/rmake.rs

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extern crate run_make_support;
2+
3+
use run_make_support::{out_dir, rustc};
4+
5+
// Test that hir-tree output doesn't crash and includes
6+
// the string constant we would expect to see.
7+
8+
fn main() {
9+
rustc()
10+
.arg("-o")
11+
.arg(&out_dir().join("input.hir"))
12+
.arg("-Zunpretty=hir-tree")
13+
.arg("input.rs")
14+
.run();
15+
let file = std::fs::read_to_string(&out_dir().join("input.hir")).unwrap();
16+
assert!(file.contains(r#""Hello, Rustaceans!\n""#));
17+
}

0 commit comments

Comments
 (0)