File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -58,18 +58,36 @@ where
58
58
{
59
59
let mut args = vec ! [ "check" . to_owned( ) ] ;
60
60
61
+ let mut fix = false ;
62
+ let mut unstable_options = false ;
63
+
61
64
for arg in old_args. by_ref ( ) {
62
- if arg == "--fix" {
63
- args[ 0 ] = "fix" . to_owned ( ) ;
64
- continue ;
65
+ match arg {
66
+ "--fix" => {
67
+ fix = true ;
68
+ continue ;
69
+ } ,
70
+ "--" => break ,
71
+ // Cover -Zunstable-options and -Z unstable-options
72
+ s if s. ends_with ( "unstable-options" ) => unstable_options = true ,
73
+ _ => { } ,
65
74
}
66
75
67
- if arg == "--" {
68
- break ;
69
- }
70
76
args. push ( arg) ;
71
77
}
72
78
79
+ if fix && !unstable_options {
80
+ panic ! ( "Usage of `--fix` requires `-Z unstable-options`" ) ;
81
+ } else {
82
+ args[ 0 ] = "fix" . to_owned ( ) ;
83
+ }
84
+
85
+ let env_name = if unstable_options {
86
+ "RUSTC_WORKSPACE_WRAPPER"
87
+ } else {
88
+ "RUSTC_WRAPPER"
89
+ } ;
90
+
73
91
let clippy_args: String = old_args. map ( |arg| format ! ( "{}__CLIPPY_HACKERY__" , arg) ) . collect ( ) ;
74
92
75
93
let mut path = std:: env:: current_exe ( )
You can’t perform that action at this time.
0 commit comments