@@ -13,7 +13,6 @@ use tracing::{debug, info, warn};
13
13
14
14
mod fixmode {
15
15
pub const EVERYTHING : & str = "yolo" ;
16
- pub const EDITION : & str = "edition" ;
17
16
}
18
17
19
18
mod settings {
@@ -23,10 +22,10 @@ mod settings {
23
22
pub const RECORD_FIXED_RUST : & str = "RUSTFIX_TEST_RECORD_FIXED_RUST" ;
24
23
}
25
24
26
- fn compile ( file : & Path , mode : & str ) -> Result < Output , Error > {
25
+ fn compile ( file : & Path ) -> Result < Output , Error > {
27
26
let tmp = tempdir ( ) ?;
28
27
29
- let mut args: Vec < OsString > = vec ! [
28
+ let args: Vec < OsString > = vec ! [
30
29
file. into( ) ,
31
30
"--error-format=json" . into( ) ,
32
31
"--emit=metadata" . into( ) ,
@@ -35,10 +34,6 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
35
34
tmp. path( ) . into( ) ,
36
35
] ;
37
36
38
- if mode == fixmode:: EDITION {
39
- args. push ( "--edition=2018" . into ( ) ) ;
40
- }
41
-
42
37
let res = Command :: new ( env:: var_os ( "RUSTC" ) . unwrap_or ( "rustc" . into ( ) ) )
43
38
. args ( & args)
44
39
. env ( "CLIPPY_DISABLE_DOCS_LINKS" , "true" )
@@ -48,8 +43,8 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
48
43
Ok ( res)
49
44
}
50
45
51
- fn compile_and_get_json_errors ( file : & Path , mode : & str ) -> Result < String , Error > {
52
- let res = compile ( file, mode ) ?;
46
+ fn compile_and_get_json_errors ( file : & Path ) -> Result < String , Error > {
47
+ let res = compile ( file) ?;
53
48
let stderr = String :: from_utf8 ( res. stderr ) ?;
54
49
if stderr. contains ( "is only accepted on the nightly compiler" ) {
55
50
panic ! ( "rustfix tests require a nightly compiler" ) ;
@@ -65,8 +60,8 @@ fn compile_and_get_json_errors(file: &Path, mode: &str) -> Result<String, Error>
65
60
}
66
61
}
67
62
68
- fn compiles_without_errors ( file : & Path , mode : & str ) -> Result < ( ) , Error > {
69
- let res = compile ( file, mode ) ?;
63
+ fn compiles_without_errors ( file : & Path ) -> Result < ( ) , Error > {
64
+ let res = compile ( file) ?;
70
65
71
66
match res. status . code ( ) {
72
67
Some ( 0 ) => Ok ( ( ) ) ,
@@ -139,8 +134,8 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
139
134
140
135
debug ! ( "next up: {:?}" , file) ;
141
136
let code = read_file ( file) . context ( format ! ( "could not read {}" , file. display( ) ) ) ?;
142
- let errors = compile_and_get_json_errors ( file , mode )
143
- . context ( format ! ( "could compile {}" , file. display( ) ) ) ?;
137
+ let errors =
138
+ compile_and_get_json_errors ( file ) . context ( format ! ( "could compile {}" , file. display( ) ) ) ?;
144
139
let suggestions =
145
140
rustfix:: get_suggestions_from_json ( & errors, & HashSet :: new ( ) , filter_suggestions)
146
141
. context ( "could not load suggestions" ) ?;
@@ -190,7 +185,7 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
190
185
diff( fixed. trim( ) , expected_fixed. trim( ) )
191
186
) ;
192
187
193
- compiles_without_errors ( & fixed_file, mode ) ?;
188
+ compiles_without_errors ( & fixed_file) ?;
194
189
195
190
Ok ( ( ) )
196
191
}
@@ -237,10 +232,3 @@ fn everything() {
237
232
tracing_subscriber:: fmt:: init ( ) ;
238
233
assert_fixtures ( "./tests/everything" , fixmode:: EVERYTHING ) ;
239
234
}
240
-
241
- #[ test]
242
- #[ ignore = "Requires custom rustc build" ]
243
- fn edition ( ) {
244
- tracing_subscriber:: fmt:: init ( ) ;
245
- assert_fixtures ( "./tests/edition" , fixmode:: EDITION ) ;
246
- }
0 commit comments