@@ -462,7 +462,7 @@ fn main_args(args: &[String]) -> isize {
462462 diag. struct_err ( "too many file operands" ) . emit ( ) ;
463463 return 1 ;
464464 }
465- let input = & matches. free [ 0 ] ;
465+ let input = matches. free [ 0 ] . clone ( ) ;
466466
467467 let mut libs = SearchPaths :: new ( ) ;
468468 for s in & matches. opt_strs ( "L" ) {
@@ -490,7 +490,7 @@ fn main_args(args: &[String]) -> isize {
490490 . collect ( ) ;
491491
492492 let should_test = matches. opt_present ( "test" ) ;
493- let markdown_input = Path :: new ( input) . extension ( )
493+ let markdown_input = Path :: new ( & input) . extension ( )
494494 . map_or ( false , |e| e == "md" || e == "markdown" ) ;
495495
496496 let output = matches. opt_str ( "o" ) . map ( |s| PathBuf :: from ( & s) ) ;
@@ -568,14 +568,14 @@ fn main_args(args: &[String]) -> isize {
568568
569569 match ( should_test, markdown_input) {
570570 ( true , true ) => {
571- return markdown:: test ( input, cfgs, libs, externs, test_args, maybe_sysroot,
571+ return markdown:: test ( & input, cfgs, libs, externs, test_args, maybe_sysroot,
572572 display_warnings, linker, edition, cg, & diag)
573573 }
574574 ( true , false ) => {
575- return test:: run ( Path :: new ( input) , cfgs, libs, externs, test_args, crate_name,
575+ return test:: run ( Path :: new ( & input) , cfgs, libs, externs, test_args, crate_name,
576576 maybe_sysroot, display_warnings, linker, edition, cg)
577577 }
578- ( false , true ) => return markdown:: render ( Path :: new ( input) ,
578+ ( false , true ) => return markdown:: render ( Path :: new ( & input) ,
579579 output. unwrap_or ( PathBuf :: from ( "doc" ) ) ,
580580 & matches, & external_html,
581581 !matches. opt_present ( "markdown-no-toc" ) , & diag) ,
@@ -584,8 +584,8 @@ fn main_args(args: &[String]) -> isize {
584584
585585 let output_format = matches. opt_str ( "w" ) ;
586586
587- let res = acquire_input ( PathBuf :: from ( input) , externs, edition, cg, & matches, error_format,
588- move |out| {
587+ let res = acquire_input ( PathBuf :: from ( input) , externs, edition, cg, matches, error_format,
588+ move |out, matches | {
589589 let Output { krate, passes, renderinfo } = out;
590590 let diag = core:: new_handler ( error_format, None , treat_err_as_bug, ui_testing) ;
591591 info ! ( "going to format" ) ;
@@ -624,11 +624,11 @@ fn acquire_input<R, F>(input: PathBuf,
624624 externs : Externs ,
625625 edition : Edition ,
626626 cg : CodegenOptions ,
627- matches : & getopts:: Matches ,
627+ matches : getopts:: Matches ,
628628 error_format : ErrorOutputType ,
629629 f : F )
630630 -> Result < R , String >
631- where R : ' static + Send , F : ' static + Send + FnOnce ( Output ) -> R {
631+ where R : ' static + Send , F : ' static + Send + FnOnce ( Output , & getopts :: Matches ) -> R {
632632 match matches. opt_str ( "r" ) . as_ref ( ) . map ( |s| & * * s) {
633633 Some ( "rust" ) => Ok ( rust_input ( input, externs, edition, cg, matches, error_format, f) ) ,
634634 Some ( s) => Err ( format ! ( "unknown input format: {}" , s) ) ,
@@ -682,11 +682,11 @@ fn rust_input<R, F>(cratefile: PathBuf,
682682 externs : Externs ,
683683 edition : Edition ,
684684 cg : CodegenOptions ,
685- matches : & getopts:: Matches ,
685+ matches : getopts:: Matches ,
686686 error_format : ErrorOutputType ,
687687 f : F ) -> R
688688where R : ' static + Send ,
689- F : ' static + Send + FnOnce ( Output ) -> R
689+ F : ' static + Send + FnOnce ( Output , & getopts :: Matches ) -> R
690690{
691691 let default_passes = if matches. opt_present ( "no-defaults" ) {
692692 passes:: DefaultPassOption :: None
@@ -731,7 +731,7 @@ where R: 'static + Send,
731731 * x == "ui-testing"
732732 } ) ;
733733
734- let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( matches, error_format) ;
734+ let ( lint_opts, describe_lints, lint_cap) = get_cmd_lint_options ( & matches, error_format) ;
735735
736736 let ( tx, rx) = channel ( ) ;
737737
@@ -783,7 +783,8 @@ where R: 'static + Send,
783783 krate = pass ( krate) ;
784784 }
785785
786- tx. send ( f ( Output { krate : krate, renderinfo : renderinfo, passes : passes } ) ) . unwrap ( ) ;
786+ tx. send ( f ( Output { krate : krate, renderinfo : renderinfo, passes : passes } ,
787+ & matches) ) . unwrap ( ) ;
787788 } ) ) ;
788789
789790 match result {
0 commit comments