@@ -59,7 +59,6 @@ pub fn main() {
59
59
}
60
60
61
61
struct ClippyCmd {
62
- unstable_options : bool ,
63
62
cargo_subcommand : & ' static str ,
64
63
args : Vec < String > ,
65
64
clippy_args : Vec < String > ,
@@ -105,21 +104,12 @@ impl ClippyCmd {
105
104
}
106
105
107
106
ClippyCmd {
108
- unstable_options,
109
107
cargo_subcommand,
110
108
args,
111
109
clippy_args,
112
110
}
113
111
}
114
112
115
- fn path_env ( & self ) -> & ' static str {
116
- if self . unstable_options {
117
- "RUSTC_WORKSPACE_WRAPPER"
118
- } else {
119
- "RUSTC_WRAPPER"
120
- }
121
- }
122
-
123
113
fn path ( ) -> PathBuf {
124
114
let mut path = env:: current_exe ( )
125
115
. expect ( "current executable path invalid" )
@@ -156,7 +146,7 @@ impl ClippyCmd {
156
146
. map ( |arg| format ! ( "{}__CLIPPY_HACKERY__" , arg) )
157
147
. collect ( ) ;
158
148
159
- cmd. env ( self . path_env ( ) , Self :: path ( ) )
149
+ cmd. env ( "RUSTC_WORKSPACE_WRAPPER" , Self :: path ( ) )
160
150
. envs ( ClippyCmd :: target_dir ( ) )
161
151
. env ( "CLIPPY_ARGS" , clippy_args)
162
152
. arg ( self . cargo_subcommand )
@@ -205,7 +195,6 @@ mod tests {
205
195
. map ( ToString :: to_string) ;
206
196
let cmd = ClippyCmd :: new ( args) ;
207
197
assert_eq ! ( "fix" , cmd. cargo_subcommand) ;
208
- assert_eq ! ( "RUSTC_WORKSPACE_WRAPPER" , cmd. path_env( ) ) ;
209
198
assert ! ( cmd. args. iter( ) . any( |arg| arg. ends_with( "unstable-options" ) ) ) ;
210
199
}
211
200
@@ -232,16 +221,5 @@ mod tests {
232
221
let args = "cargo clippy" . split_whitespace ( ) . map ( ToString :: to_string) ;
233
222
let cmd = ClippyCmd :: new ( args) ;
234
223
assert_eq ! ( "check" , cmd. cargo_subcommand) ;
235
- assert_eq ! ( "RUSTC_WRAPPER" , cmd. path_env( ) ) ;
236
- }
237
-
238
- #[ test]
239
- fn check_unstable ( ) {
240
- let args = "cargo clippy -Zunstable-options"
241
- . split_whitespace ( )
242
- . map ( ToString :: to_string) ;
243
- let cmd = ClippyCmd :: new ( args) ;
244
- assert_eq ! ( "check" , cmd. cargo_subcommand) ;
245
- assert_eq ! ( "RUSTC_WORKSPACE_WRAPPER" , cmd. path_env( ) ) ;
246
224
}
247
225
}
0 commit comments