File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,15 @@ pub fn main() {
299
299
rustc_driver:: catch_fatal_errors ( move || {
300
300
let mut orig_args: Vec < String > = env:: args ( ) . collect ( ) ;
301
301
302
+ // make "clippy-driver --rustc" work like a subcommand that passes further args to "rustc"
303
+ // for example `clippy-driver --rustc --version` will print the rustc version that clippy-driver
304
+ // uses
305
+ if let Some ( pos) = orig_args. iter ( ) . position ( |arg| arg == "--rustc" ) {
306
+ orig_args. remove ( pos) ;
307
+ orig_args[ 0 ] = "rustc" . to_string ( ) ;
308
+ return rustc_driver:: run_compiler ( & orig_args, & mut DefaultCallbacks , None , None ) ;
309
+ }
310
+
302
311
if orig_args. iter ( ) . any ( |a| a == "--version" || a == "-V" ) {
303
312
let version_info = rustc_tools_util:: get_version_info!( ) ;
304
313
println ! ( "{}" , version_info) ;
You can’t perform that action at this time.
0 commit comments