@@ -24,8 +24,7 @@ fn has_sdk_version(file: &str, version: &str) {
24
24
25
25
fn main ( ) {
26
26
// 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 ( ) ;
29
28
let current_deployment_target = current_deployment_target. split ( '=' ) . last ( ) . unwrap ( ) . trim ( ) ;
30
29
31
30
// Fetch current SDK version via. xcrun.
@@ -45,15 +44,15 @@ fn main() {
45
44
let current_sdk_version = current_sdk_version. trim ( ) ;
46
45
47
46
// 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 ( ) ;
49
48
// Set to 0, which means not set or "n/a".
50
49
has_sdk_version ( "foo.o" , "n/a" ) ;
51
50
52
51
// Check the SDK version in the .rmeta file, as set in `create_object_file`.
53
52
//
54
53
// This is just to ensure that we don't set some odd version in `create_object_file`,
55
54
// 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 ( ) ;
57
56
// Extra .rmeta file (which is encoded as an object file).
58
57
cmd ( "ar" ) . arg ( "-x" ) . arg ( "libfoo.rlib" ) . arg ( "lib.rmeta" ) . run ( ) ;
59
58
has_sdk_version ( "lib.rmeta" , "n/a" ) ;
@@ -69,7 +68,6 @@ fn main() {
69
68
// Test with clang
70
69
let file_name = format ! ( "foo_cc{file_ext}" ) ;
71
70
rustc ( )
72
- . target ( target ( ) )
73
71
. crate_type ( "bin" )
74
72
. arg ( "-Clinker-flavor=gcc" )
75
73
. input ( "foo.rs" )
@@ -80,7 +78,6 @@ fn main() {
80
78
// Test with ld64
81
79
let file_name = format ! ( "foo_ld{file_ext}" ) ;
82
80
rustc ( )
83
- . target ( target ( ) )
84
81
. crate_type ( "bin" )
85
82
. arg ( "-Clinker-flavor=ld" )
86
83
. input ( "foo.rs" )
0 commit comments