@@ -292,7 +292,7 @@ struct UnusedExterns {
292292
293293fn run_test (
294294 test : & str ,
295- cratename : & str ,
295+ crate_name : & str ,
296296 line : usize ,
297297 options : Options ,
298298 should_panic : bool ,
@@ -311,7 +311,7 @@ fn run_test(
311311 report_unused_externs : impl Fn ( UnusedExterns ) ,
312312) -> Result < ( ) , TestFailure > {
313313 let ( test, line_offset, supports_color) =
314- make_test ( test, Some ( cratename ) , as_test_harness, opts, edition, Some ( test_id) ) ;
314+ make_test ( test, Some ( crate_name ) , as_test_harness, opts, edition, Some ( test_id) ) ;
315315
316316 let output_file = outdir. path ( ) . join ( "rust_out" ) ;
317317
@@ -478,7 +478,7 @@ fn run_test(
478478/// lines before the test code begins as well as if the output stream supports colors or not.
479479crate fn make_test (
480480 s : & str ,
481- cratename : Option < & str > ,
481+ crate_name : Option < & str > ,
482482 dont_insert_main : bool ,
483483 opts : & TestOptions ,
484484 edition : Edition ,
@@ -539,7 +539,7 @@ crate fn make_test(
539539 let sess = ParseSess :: with_span_handler ( handler, sm) ;
540540
541541 let mut found_main = false ;
542- let mut found_extern_crate = cratename . is_none ( ) ;
542+ let mut found_extern_crate = crate_name . is_none ( ) ;
543543 let mut found_macro = false ;
544544
545545 let mut parser = match maybe_new_parser_from_source_str ( & sess, filename, source) {
@@ -566,13 +566,13 @@ crate fn make_test(
566566
567567 if !found_extern_crate {
568568 if let ast:: ItemKind :: ExternCrate ( original) = item. kind {
569- // This code will never be reached if `cratename ` is none because
569+ // This code will never be reached if `crate_name ` is none because
570570 // `found_extern_crate` is initialized to `true` if it is none.
571- let cratename = cratename . unwrap ( ) ;
571+ let crate_name = crate_name . unwrap ( ) ;
572572
573573 match original {
574- Some ( name) => found_extern_crate = name. as_str ( ) == cratename ,
575- None => found_extern_crate = item. ident . as_str ( ) == cratename ,
574+ Some ( name) => found_extern_crate = name. as_str ( ) == crate_name ,
575+ None => found_extern_crate = item. ident . as_str ( ) == crate_name ,
576576 }
577577 }
578578 }
@@ -630,14 +630,14 @@ crate fn make_test(
630630
631631 // Don't inject `extern crate std` because it's already injected by the
632632 // compiler.
633- if !already_has_extern_crate && !opts. no_crate_inject && cratename != Some ( "std" ) {
634- if let Some ( cratename ) = cratename {
633+ if !already_has_extern_crate && !opts. no_crate_inject && crate_name != Some ( "std" ) {
634+ if let Some ( crate_name ) = crate_name {
635635 // Don't inject `extern crate` if the crate is never used.
636636 // NOTE: this is terribly inaccurate because it doesn't actually
637637 // parse the source, but only has false positives, not false
638638 // negatives.
639- if s. contains ( cratename ) {
640- prog. push_str ( & format ! ( "extern crate r#{};\n " , cratename ) ) ;
639+ if s. contains ( crate_name ) {
640+ prog. push_str ( & format ! ( "extern crate r#{};\n " , crate_name ) ) ;
641641 line_offset += 1 ;
642642 }
643643 }
@@ -796,7 +796,7 @@ crate struct Collector {
796796 options : Options ,
797797 use_headers : bool ,
798798 enable_per_target_ignores : bool ,
799- cratename : String ,
799+ crate_name : String ,
800800 opts : TestOptions ,
801801 position : Span ,
802802 source_map : Option < Lrc < SourceMap > > ,
@@ -808,7 +808,7 @@ crate struct Collector {
808808
809809impl Collector {
810810 crate fn new (
811- cratename : String ,
811+ crate_name : String ,
812812 options : Options ,
813813 use_headers : bool ,
814814 opts : TestOptions ,
@@ -822,7 +822,7 @@ impl Collector {
822822 options,
823823 use_headers,
824824 enable_per_target_ignores,
825- cratename ,
825+ crate_name ,
826826 opts,
827827 position : DUMMY_SP ,
828828 source_map,
@@ -870,7 +870,7 @@ impl Tester for Collector {
870870 fn add_test ( & mut self , test : String , config : LangString , line : usize ) {
871871 let filename = self . get_filename ( ) ;
872872 let name = self . generate_name ( line, & filename) ;
873- let cratename = self . cratename . to_string ( ) ;
873+ let crate_name = self . crate_name . to_string ( ) ;
874874 let opts = self . opts . clone ( ) ;
875875 let edition = config. edition . unwrap_or ( self . options . edition ) ;
876876 let options = self . options . clone ( ) ;
@@ -953,7 +953,7 @@ impl Tester for Collector {
953953 } ;
954954 let res = run_test (
955955 & test,
956- & cratename ,
956+ & crate_name ,
957957 line,
958958 options,
959959 config. should_panic ,
0 commit comments