2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4
4
use std:: path:: Path ;
5
5
6
6
use run_make_support:: rfs:: { create_dir, remove_dir_all} ;
7
- use run_make_support:: { run, rustc, rustdoc} ;
7
+ use run_make_support:: { run, rustc, rustdoc, target } ;
8
8
9
9
fn setup_test_env < F : FnOnce ( & Path , & Path ) > ( callback : F ) {
10
10
let out_dir = Path :: new ( "doctests" ) ;
11
11
create_dir ( & out_dir) ;
12
- rustc ( ) . input ( "t.rs" ) . crate_type ( "rlib" ) . run ( ) ;
12
+ rustc ( ) . target ( target ( ) ) . input ( "t.rs" ) . crate_type ( "rlib" ) . run ( ) ;
13
13
callback ( & out_dir, Path :: new ( "libt.rlib" ) ) ;
14
14
remove_dir_all ( out_dir) ;
15
15
}
@@ -22,6 +22,7 @@ fn check_generated_binaries() {
22
22
fn main ( ) {
23
23
setup_test_env ( |out_dir, extern_path| {
24
24
rustdoc ( )
25
+ . target ( target ( ) )
25
26
. input ( "t.rs" )
26
27
. arg ( "-Zunstable-options" )
27
28
. arg ( "--test" )
@@ -33,6 +34,7 @@ fn main() {
33
34
} ) ;
34
35
setup_test_env ( |out_dir, extern_path| {
35
36
rustdoc ( )
37
+ . target ( target ( ) )
36
38
. input ( "t.rs" )
37
39
. arg ( "-Zunstable-options" )
38
40
. arg ( "--test" )
@@ -49,6 +51,7 @@ fn main() {
49
51
create_dir ( & run_dir_path) ;
50
52
51
53
rustdoc ( )
54
+ . target ( target ( ) )
52
55
. input ( "t.rs" )
53
56
. arg ( "-Zunstable-options" )
54
57
. arg ( "--test" )
Original file line number Diff line number Diff line change 3
3
// warnings when used, and that binaries produced by it can also be successfully executed.
4
4
// See https://github.com/rust-lang/rust/pull/23238
5
5
6
- use run_make_support:: { run, rustc} ;
6
+ use run_make_support:: { run, rustc, target } ;
7
7
8
8
fn main ( ) {
9
- let out = rustc ( ) . input ( "foo.rs" ) . arg ( "-Ctarget-cpu=native" ) . run ( ) . stderr_utf8 ( ) ;
9
+ let out =
10
+ rustc ( ) . target ( target ( ) ) . input ( "foo.rs" ) . arg ( "-Ctarget-cpu=native" ) . run ( ) . stderr_utf8 ( ) ;
10
11
run ( "foo" ) ;
11
12
// There should be zero warnings emitted - the bug would cause "unknown CPU `native`"
12
13
// to be printed out.
0 commit comments