@@ -14,36 +14,42 @@ use std::iter::FromIterator;
14
14
15
15
use run_make_support:: { rustc, tmp_dir} ;
16
16
17
+ struct PrintCfg {
18
+ target : & ' static str ,
19
+ includes : & ' static [ & ' static str ] ,
20
+ disallow : & ' static [ & ' static str ] ,
21
+ }
22
+
17
23
fn main ( ) {
18
- check (
19
- /* target*/ "x86_64-pc-windows-gnu" ,
20
- /* includes*/ & [ "windows" , "target_arch=\" x86_64\" " ] ,
21
- /* disallow*/ & [ "unix" ] ,
22
- ) ;
23
- check (
24
- /* target*/ "i686-pc-windows-msvc" ,
25
- /* includes*/ & [ "windows" , "target_env=\" msvc\" " ] ,
26
- /* disallow*/ & [ "unix" ] ,
27
- ) ;
28
- check (
29
- /* target*/ "i686-apple-darwin" ,
30
- /* includes*/ & [ "unix" , "target_os=\" macos\" " , "target_vendor=\" apple\" " ] ,
31
- /* disallow*/ & [ "windows" ] ,
32
- ) ;
33
- check (
34
- /* target*/ "i686-unknown-linux-gnu" ,
35
- /* includes*/ & [ "unix" , "target_env=\" gnu\" " ] ,
36
- /* disallow*/ & [ "windows" ] ,
37
- ) ;
38
- check (
39
- /* target*/ "arm-unknown-linux-gnueabihf" ,
40
- /* includes*/ & [ "unix" , "target_abi=\" eabihf\" " ] ,
41
- /* disallow*/ & [ "windows" ] ,
42
- ) ;
24
+ check ( PrintCfg {
25
+ target : "x86_64-pc-windows-gnu" ,
26
+ includes : & [ "windows" , "target_arch=\" x86_64\" " ] ,
27
+ disallow : & [ "unix" ] ,
28
+ } ) ;
29
+ check ( PrintCfg {
30
+ target : "i686-pc-windows-msvc" ,
31
+ includes : & [ "windows" , "target_env=\" msvc\" " ] ,
32
+ disallow : & [ "unix" ] ,
33
+ } ) ;
34
+ check ( PrintCfg {
35
+ target : "i686-apple-darwin" ,
36
+ includes : & [ "unix" , "target_os=\" macos\" " , "target_vendor=\" apple\" " ] ,
37
+ disallow : & [ "windows" ] ,
38
+ } ) ;
39
+ check ( PrintCfg {
40
+ target : "i686-unknown-linux-gnu" ,
41
+ includes : & [ "unix" , "target_env=\" gnu\" " ] ,
42
+ disallow : & [ "windows" ] ,
43
+ } ) ;
44
+ check ( PrintCfg {
45
+ target : "arm-unknown-linux-gnueabihf" ,
46
+ includes : & [ "unix" , "target_abi=\" eabihf\" " ] ,
47
+ disallow : & [ "windows" ] ,
48
+ } ) ;
43
49
}
44
50
45
- fn check ( target : & str , includes : & [ & str ] , disallow : & [ & str ] ) {
46
- fn _inner ( output : & str , includes : & [ & str ] , disallow : & [ & str ] ) {
51
+ fn check ( PrintCfg { target , includes, disallow } : PrintCfg ) {
52
+ fn check_ ( output : & str , includes : & [ & str ] , disallow : & [ & str ] ) {
47
53
let mut found = HashSet :: < String > :: new ( ) ;
48
54
let mut recorded = HashSet :: < String > :: new ( ) ;
49
55
@@ -82,7 +88,7 @@ fn check(target: &str, includes: &[&str], disallow: &[&str]) {
82
88
83
89
let stdout = String :: from_utf8 ( output. stdout ) . unwrap ( ) ;
84
90
85
- _inner ( & stdout, includes, disallow) ;
91
+ check_ ( & stdout, includes, disallow) ;
86
92
}
87
93
88
94
// --print=cfg=PATH
@@ -95,6 +101,6 @@ fn check(target: &str, includes: &[&str], disallow: &[&str]) {
95
101
96
102
let output = std:: fs:: read_to_string ( & tmp_path) . unwrap ( ) ;
97
103
98
- _inner ( & output, includes, disallow) ;
104
+ check_ ( & output, includes, disallow) ;
99
105
}
100
106
}
0 commit comments