@@ -292,7 +292,7 @@ struct UnusedExterns {
292
292
293
293
fn run_test (
294
294
test : & str ,
295
- cratename : & str ,
295
+ crate_name : & str ,
296
296
line : usize ,
297
297
options : Options ,
298
298
should_panic : bool ,
@@ -311,7 +311,7 @@ fn run_test(
311
311
report_unused_externs : impl Fn ( UnusedExterns ) ,
312
312
) -> Result < ( ) , TestFailure > {
313
313
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) ) ;
315
315
316
316
let output_file = outdir. path ( ) . join ( "rust_out" ) ;
317
317
@@ -478,7 +478,7 @@ fn run_test(
478
478
/// lines before the test code begins as well as if the output stream supports colors or not.
479
479
crate fn make_test (
480
480
s : & str ,
481
- cratename : Option < & str > ,
481
+ crate_name : Option < & str > ,
482
482
dont_insert_main : bool ,
483
483
opts : & TestOptions ,
484
484
edition : Edition ,
@@ -539,7 +539,7 @@ crate fn make_test(
539
539
let sess = ParseSess :: with_span_handler ( handler, sm) ;
540
540
541
541
let mut found_main = false ;
542
- let mut found_extern_crate = cratename . is_none ( ) ;
542
+ let mut found_extern_crate = crate_name . is_none ( ) ;
543
543
let mut found_macro = false ;
544
544
545
545
let mut parser = match maybe_new_parser_from_source_str ( & sess, filename, source) {
@@ -566,13 +566,13 @@ crate fn make_test(
566
566
567
567
if !found_extern_crate {
568
568
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
570
570
// `found_extern_crate` is initialized to `true` if it is none.
571
- let cratename = cratename . unwrap ( ) ;
571
+ let crate_name = crate_name . unwrap ( ) ;
572
572
573
573
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 ,
576
576
}
577
577
}
578
578
}
@@ -630,14 +630,14 @@ crate fn make_test(
630
630
631
631
// Don't inject `extern crate std` because it's already injected by the
632
632
// 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 {
635
635
// Don't inject `extern crate` if the crate is never used.
636
636
// NOTE: this is terribly inaccurate because it doesn't actually
637
637
// parse the source, but only has false positives, not false
638
638
// 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 ) ) ;
641
641
line_offset += 1 ;
642
642
}
643
643
}
@@ -796,7 +796,7 @@ crate struct Collector {
796
796
options : Options ,
797
797
use_headers : bool ,
798
798
enable_per_target_ignores : bool ,
799
- cratename : String ,
799
+ crate_name : String ,
800
800
opts : TestOptions ,
801
801
position : Span ,
802
802
source_map : Option < Lrc < SourceMap > > ,
@@ -808,7 +808,7 @@ crate struct Collector {
808
808
809
809
impl Collector {
810
810
crate fn new (
811
- cratename : String ,
811
+ crate_name : String ,
812
812
options : Options ,
813
813
use_headers : bool ,
814
814
opts : TestOptions ,
@@ -822,7 +822,7 @@ impl Collector {
822
822
options,
823
823
use_headers,
824
824
enable_per_target_ignores,
825
- cratename ,
825
+ crate_name ,
826
826
opts,
827
827
position : DUMMY_SP ,
828
828
source_map,
@@ -870,7 +870,7 @@ impl Tester for Collector {
870
870
fn add_test ( & mut self , test : String , config : LangString , line : usize ) {
871
871
let filename = self . get_filename ( ) ;
872
872
let name = self . generate_name ( line, & filename) ;
873
- let cratename = self . cratename . to_string ( ) ;
873
+ let crate_name = self . crate_name . to_string ( ) ;
874
874
let opts = self . opts . clone ( ) ;
875
875
let edition = config. edition . unwrap_or ( self . options . edition ) ;
876
876
let options = self . options . clone ( ) ;
@@ -953,7 +953,7 @@ impl Tester for Collector {
953
953
} ;
954
954
let res = run_test (
955
955
& test,
956
- & cratename ,
956
+ & crate_name ,
957
957
line,
958
958
options,
959
959
config. should_panic ,
0 commit comments