@@ -14,7 +14,6 @@ use tracing::{debug, info, warn};
1414
1515mod fixmode {
1616 pub const EVERYTHING : & str = "yolo" ;
17- pub const EDITION : & str = "edition" ;
1817}
1918
2019mod settings {
@@ -24,10 +23,10 @@ mod settings {
2423 pub const RECORD_FIXED_RUST : & str = "RUSTFIX_TEST_RECORD_FIXED_RUST" ;
2524}
2625
27- fn compile ( file : & Path , mode : & str ) -> Result < Output , Error > {
26+ fn compile ( file : & Path ) -> Result < Output , Error > {
2827 let tmp = tempdir ( ) ?;
2928
30- let mut args: Vec < OsString > = vec ! [
29+ let args: Vec < OsString > = vec ! [
3130 file. into( ) ,
3231 "--error-format=json" . into( ) ,
3332 "--emit=metadata" . into( ) ,
@@ -36,10 +35,6 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
3635 tmp. path( ) . into( ) ,
3736 ] ;
3837
39- if mode == fixmode:: EDITION {
40- args. push ( "--edition=2018" . into ( ) ) ;
41- }
42-
4338 let res = Command :: new ( env:: var_os ( "RUSTC" ) . unwrap_or ( "rustc" . into ( ) ) )
4439 . args ( & args)
4540 . env ( "CLIPPY_DISABLE_DOCS_LINKS" , "true" )
@@ -49,8 +44,8 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
4944 Ok ( res)
5045}
5146
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) ?;
5449 let stderr = String :: from_utf8 ( res. stderr ) ?;
5550 if stderr. contains ( "is only accepted on the nightly compiler" ) {
5651 panic ! ( "rustfix tests require a nightly compiler" ) ;
@@ -66,8 +61,8 @@ fn compile_and_get_json_errors(file: &Path, mode: &str) -> Result<String, Error>
6661 }
6762}
6863
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) ?;
7166
7267 match res. status . code ( ) {
7368 Some ( 0 ) => Ok ( ( ) ) ,
@@ -140,8 +135,8 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
140135
141136 debug ! ( "next up: {:?}" , file) ;
142137 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( ) ) ) ?;
145140 let suggestions =
146141 rustfix:: get_suggestions_from_json ( & errors, & HashSet :: new ( ) , filter_suggestions)
147142 . context ( "could not load suggestions" ) ?;
@@ -191,7 +186,7 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
191186 diff( fixed. trim( ) , expected_fixed. trim( ) )
192187 ) ;
193188
194- compiles_without_errors ( & fixed_file, mode ) ?;
189+ compiles_without_errors ( & fixed_file) ?;
195190
196191 Ok ( ( ) )
197192}
@@ -238,10 +233,3 @@ fn everything() {
238233 tracing_subscriber:: fmt:: init ( ) ;
239234 assert_fixtures ( "./tests/everything" , fixmode:: EVERYTHING ) ;
240235}
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