@@ -13,7 +13,6 @@ use tracing::{debug, info, warn};
1313
1414mod fixmode {
1515 pub const EVERYTHING : & str = "yolo" ;
16- pub const EDITION : & str = "edition" ;
1716}
1817
1918mod settings {
@@ -23,10 +22,10 @@ mod settings {
2322 pub const RECORD_FIXED_RUST : & str = "RUSTFIX_TEST_RECORD_FIXED_RUST" ;
2423}
2524
26- fn compile ( file : & Path , mode : & str ) -> Result < Output , Error > {
25+ fn compile ( file : & Path ) -> Result < Output , Error > {
2726 let tmp = tempdir ( ) ?;
2827
29- let mut args: Vec < OsString > = vec ! [
28+ let args: Vec < OsString > = vec ! [
3029 file. into( ) ,
3130 "--error-format=json" . into( ) ,
3231 "--emit=metadata" . into( ) ,
@@ -35,10 +34,6 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
3534 tmp. path( ) . into( ) ,
3635 ] ;
3736
38- if mode == fixmode:: EDITION {
39- args. push ( "--edition=2018" . into ( ) ) ;
40- }
41-
4237 let res = Command :: new ( env:: var_os ( "RUSTC" ) . unwrap_or ( "rustc" . into ( ) ) )
4338 . args ( & args)
4439 . env ( "CLIPPY_DISABLE_DOCS_LINKS" , "true" )
@@ -48,8 +43,8 @@ fn compile(file: &Path, mode: &str) -> Result<Output, Error> {
4843 Ok ( res)
4944}
5045
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) ?;
5348 let stderr = String :: from_utf8 ( res. stderr ) ?;
5449 if stderr. contains ( "is only accepted on the nightly compiler" ) {
5550 panic ! ( "rustfix tests require a nightly compiler" ) ;
@@ -65,8 +60,8 @@ fn compile_and_get_json_errors(file: &Path, mode: &str) -> Result<String, Error>
6560 }
6661}
6762
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) ?;
7065
7166 match res. status . code ( ) {
7267 Some ( 0 ) => Ok ( ( ) ) ,
@@ -139,8 +134,8 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
139134
140135 debug ! ( "next up: {:?}" , file) ;
141136 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( ) ) ) ?;
144139 let suggestions =
145140 rustfix:: get_suggestions_from_json ( & errors, & HashSet :: new ( ) , filter_suggestions)
146141 . context ( "could not load suggestions" ) ?;
@@ -190,7 +185,7 @@ fn test_rustfix_with_file<P: AsRef<Path>>(file: P, mode: &str) -> Result<(), Err
190185 diff( fixed. trim( ) , expected_fixed. trim( ) )
191186 ) ;
192187
193- compiles_without_errors ( & fixed_file, mode ) ?;
188+ compiles_without_errors ( & fixed_file) ?;
194189
195190 Ok ( ( ) )
196191}
@@ -237,10 +232,3 @@ fn everything() {
237232 tracing_subscriber:: fmt:: init ( ) ;
238233 assert_fixtures ( "./tests/everything" , fixmode:: EVERYTHING ) ;
239234}
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