@@ -24,8 +24,7 @@ fn has_sdk_version(file: &str, version: &str) {
2424
2525fn main ( ) {
2626 // Fetch rustc's inferred deployment target.
27- let current_deployment_target =
28- rustc ( ) . target ( target ( ) ) . print ( "deployment-target" ) . run ( ) . stdout_utf8 ( ) ;
27+ let current_deployment_target = rustc ( ) . print ( "deployment-target" ) . run ( ) . stdout_utf8 ( ) ;
2928 let current_deployment_target = current_deployment_target. split ( '=' ) . last ( ) . unwrap ( ) . trim ( ) ;
3029
3130 // Fetch current SDK version via. xcrun.
@@ -45,15 +44,15 @@ fn main() {
4544 let current_sdk_version = current_sdk_version. trim ( ) ;
4645
4746 // Check the SDK version in the object file produced by the codegen backend.
48- rustc ( ) . target ( target ( ) ) . crate_type ( "lib" ) . emit ( "obj" ) . input ( "foo.rs" ) . output ( "foo.o" ) . run ( ) ;
47+ rustc ( ) . crate_type ( "lib" ) . emit ( "obj" ) . input ( "foo.rs" ) . output ( "foo.o" ) . run ( ) ;
4948 // Set to 0, which means not set or "n/a".
5049 has_sdk_version ( "foo.o" , "n/a" ) ;
5150
5251 // Check the SDK version in the .rmeta file, as set in `create_object_file`.
5352 //
5453 // This is just to ensure that we don't set some odd version in `create_object_file`,
5554 // if the rmeta file is packed in a different way in the future, this can safely be removed.
56- rustc ( ) . target ( target ( ) ) . crate_type ( "rlib" ) . input ( "foo.rs" ) . output ( "libfoo.rlib" ) . run ( ) ;
55+ rustc ( ) . crate_type ( "rlib" ) . input ( "foo.rs" ) . output ( "libfoo.rlib" ) . run ( ) ;
5756 // Extra .rmeta file (which is encoded as an object file).
5857 cmd ( "ar" ) . arg ( "-x" ) . arg ( "libfoo.rlib" ) . arg ( "lib.rmeta" ) . run ( ) ;
5958 has_sdk_version ( "lib.rmeta" , "n/a" ) ;
@@ -69,7 +68,6 @@ fn main() {
6968 // Test with clang
7069 let file_name = format ! ( "foo_cc{file_ext}" ) ;
7170 rustc ( )
72- . target ( target ( ) )
7371 . crate_type ( "bin" )
7472 . arg ( "-Clinker-flavor=gcc" )
7573 . input ( "foo.rs" )
@@ -80,7 +78,6 @@ fn main() {
8078 // Test with ld64
8179 let file_name = format ! ( "foo_ld{file_ext}" ) ;
8280 rustc ( )
83- . target ( target ( ) )
8481 . crate_type ( "bin" )
8582 . arg ( "-Clinker-flavor=ld" )
8683 . input ( "foo.rs" )
0 commit comments