@@ -70,7 +70,6 @@ impl ClippyCmd {
7070 I : Iterator < Item = String > ,
7171 {
7272 let mut cargo_subcommand = "check" ;
73- let mut unstable_options = false ;
7473 let mut args = vec ! [ ] ;
7574
7675 for arg in old_args. by_ref ( ) {
@@ -80,18 +79,12 @@ impl ClippyCmd {
8079 continue ;
8180 } ,
8281 "--" => break ,
83- // Cover -Zunstable-options and -Z unstable-options
84- s if s. ends_with ( "unstable-options" ) => unstable_options = true ,
8582 _ => { } ,
8683 }
8784
8885 args. push ( arg) ;
8986 }
9087
91- if cargo_subcommand == "fix" && !unstable_options {
92- panic ! ( "Usage of `--fix` requires `-Z unstable-options`" ) ;
93- }
94-
9588 let mut clippy_args: Vec < String > = old_args. collect ( ) ;
9689 if cargo_subcommand == "fix" && !clippy_args. iter ( ) . any ( |arg| arg == "--no-deps" ) {
9790 clippy_args. push ( "--no-deps" . into ( ) ) ;
@@ -176,34 +169,23 @@ mod tests {
176169 use super :: ClippyCmd ;
177170
178171 #[ test]
179- #[ should_panic]
180- fn fix_without_unstable ( ) {
172+ fn fix ( ) {
181173 let args = "cargo clippy --fix" . split_whitespace ( ) . map ( ToString :: to_string) ;
182- ClippyCmd :: new ( args) ;
183- }
184-
185- #[ test]
186- fn fix_unstable ( ) {
187- let args = "cargo clippy --fix -Zunstable-options"
188- . split_whitespace ( )
189- . map ( ToString :: to_string) ;
190174 let cmd = ClippyCmd :: new ( args) ;
191175 assert_eq ! ( "fix" , cmd. cargo_subcommand) ;
192- assert ! ( cmd. args. iter( ) . any( |arg| arg. ends_with( "unstable-options" ) ) ) ;
176+ assert ! ( ! cmd. args. iter( ) . any( |arg| arg. ends_with( "unstable-options" ) ) ) ;
193177 }
194178
195179 #[ test]
196180 fn fix_implies_no_deps ( ) {
197- let args = "cargo clippy --fix -Zunstable-options"
198- . split_whitespace ( )
199- . map ( ToString :: to_string) ;
181+ let args = "cargo clippy --fix" . split_whitespace ( ) . map ( ToString :: to_string) ;
200182 let cmd = ClippyCmd :: new ( args) ;
201183 assert ! ( cmd. clippy_args. iter( ) . any( |arg| arg == "--no-deps" ) ) ;
202184 }
203185
204186 #[ test]
205187 fn no_deps_not_duplicated_with_fix ( ) {
206- let args = "cargo clippy --fix -Zunstable-options - - --no-deps"
188+ let args = "cargo clippy --fix -- --no-deps"
207189 . split_whitespace ( )
208190 . map ( ToString :: to_string) ;
209191 let cmd = ClippyCmd :: new ( args) ;
0 commit comments