File tree 1 file changed +5
-14
lines changed
dev-tools/gen-target-info/src
1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -30,20 +30,11 @@ fn generate_target_mapping(f: &mut File, target_specs: &RustcTargetSpecs) -> std
30
30
// FIXME(madsmtm): Should become unnecessary after
31
31
// https://github.com/rust-lang/rust/pull/131037
32
32
let unversioned_llvm_target = if spec. llvm_target . contains ( "apple" ) {
33
- let mut components = spec. llvm_target . split ( "-" ) ;
34
- let arch = components. next ( ) . expect ( "LLVM target should have arch" ) ;
35
- let vendor = components. next ( ) . expect ( "LLVM target should have vendor" ) ;
36
- let os = components. next ( ) . expect ( "LLVM target should have os" ) ;
37
- let environment = components. next ( ) ;
38
- assert_eq ! ( components. next( ) , None , "too many LLVM target components" ) ;
39
-
40
- let os = os. trim_end_matches ( |c : char | c. is_numeric ( ) || c == '.' ) ;
41
-
42
- if let Some ( env) = environment {
43
- format ! ( "{arch}-{vendor}-{os}-{env}" )
44
- } else {
45
- format ! ( "{arch}-{vendor}-{os}" )
46
- }
33
+ let mut components = spec. llvm_target . split ( "-" ) . collect :: < Vec < _ > > ( ) ;
34
+
35
+ components[ 2 ] = components[ 2 ] . trim_end_matches ( |c : char | c. is_numeric ( ) || c == '.' ) ;
36
+
37
+ components. join ( "-" )
47
38
} else {
48
39
spec. llvm_target . clone ( )
49
40
} ;
You can’t perform that action at this time.
0 commit comments