@@ -15,18 +15,28 @@ fn main() {
1515 . run_fail ( )
1616 . assert_stderr_contains ( "error loading target specification" ) ;
1717 rustc ( )
18+ . arg ( "-Zunstable-options" )
1819 . input ( "foo.rs" )
1920 . target ( "my-incomplete-platform.json" )
2021 . run_fail ( )
2122 . assert_stderr_contains ( "missing field `llvm-target`" ) ;
23+ let test_platform = rustc ( )
24+ . input ( "foo.rs" )
25+ . target ( "my-x86_64-unknown-linux-gnu-platform" )
26+ . crate_type ( "lib" )
27+ . emit ( "asm" )
28+ . run_fail ( )
29+ . assert_stderr_contains ( "custom targets are unstable and require `-Zunstable-options`" ) ;
2230 rustc ( )
31+ . arg ( "-Zunstable-options" )
2332 . env ( "RUST_TARGET_PATH" , "." )
2433 . input ( "foo.rs" )
2534 . target ( "my-awesome-platform" )
2635 . crate_type ( "lib" )
2736 . emit ( "asm" )
2837 . run ( ) ;
2938 rustc ( )
39+ . arg ( "-Zunstable-options" )
3040 . env ( "RUST_TARGET_PATH" , "." )
3141 . input ( "foo.rs" )
3242 . target ( "my-x86_64-unknown-linux-gnu-platform" )
@@ -52,27 +62,31 @@ fn main() {
5262 . actual_text ( "test-platform-2" , test_platform_2)
5363 . run ( ) ;
5464 rustc ( )
65+ . arg ( "-Zunstable-options" )
5566 . input ( "foo.rs" )
5667 . target ( "endianness-mismatch" )
5768 . run_fail ( )
5869 . assert_stderr_contains ( r#""data-layout" claims architecture is little-endian"# ) ;
5970 rustc ( )
71+ . arg ( "-Zunstable-options" )
6072 . input ( "foo.rs" )
6173 . target ( "mismatching-data-layout" )
6274 . crate_type ( "lib" )
6375 . run_fail ( )
6476 . assert_stderr_contains ( "data-layout for target" ) ;
6577 rustc ( )
78+ . arg ( "-Zunstable-options" )
6679 . input ( "foo.rs" )
6780 . target ( "require-explicit-cpu" )
6881 . crate_type ( "lib" )
6982 . run_fail ( )
7083 . assert_stderr_contains ( "target requires explicitly specifying a cpu" ) ;
7184 rustc ( )
85+ . arg ( "-Zunstable-options" )
7286 . input ( "foo.rs" )
7387 . target ( "require-explicit-cpu" )
7488 . crate_type ( "lib" )
7589 . arg ( "-Ctarget-cpu=generic" )
7690 . run ( ) ;
77- rustc ( ) . target ( "require-explicit-cpu" ) . arg ( "--print= target-cpus") . run ( ) ;
91+ rustc ( ) . arg ( "-Zunstable-options" ) . target ( "require-explicit-cpu" ) . print ( " target-cpus") . run ( ) ;
7892}
0 commit comments