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