@@ -97,7 +97,6 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
97
97
fn annotate < F > (
98
98
& mut self ,
99
99
hir_id : HirId ,
100
- attrs : & [ Attribute ] ,
101
100
item_sp : Span ,
102
101
kind : AnnotationKind ,
103
102
inherit_deprecation : InheritDeprecation ,
@@ -107,6 +106,7 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
107
106
) where
108
107
F : FnOnce ( & mut Self ) ,
109
108
{
109
+ let attrs = self . tcx . hir ( ) . attrs ( hir_id) ;
110
110
debug ! ( "annotate(id = {:?}, attrs = {:?})" , hir_id, attrs) ;
111
111
let mut did_error = false ;
112
112
if !self . tcx . features ( ) . staged_api {
@@ -385,7 +385,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
385
385
if let Some ( ctor_hir_id) = sd. ctor_hir_id ( ) {
386
386
self . annotate (
387
387
ctor_hir_id,
388
- & i. attrs ,
389
388
i. span ,
390
389
AnnotationKind :: Required ,
391
390
InheritDeprecation :: Yes ,
@@ -400,7 +399,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
400
399
401
400
self . annotate (
402
401
i. hir_id ( ) ,
403
- & i. attrs ,
404
402
i. span ,
405
403
kind,
406
404
InheritDeprecation :: Yes ,
@@ -414,7 +412,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
414
412
fn visit_trait_item ( & mut self , ti : & ' tcx hir:: TraitItem < ' tcx > ) {
415
413
self . annotate (
416
414
ti. hir_id ( ) ,
417
- & ti. attrs ,
418
415
ti. span ,
419
416
AnnotationKind :: Required ,
420
417
InheritDeprecation :: Yes ,
@@ -431,7 +428,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
431
428
if self . in_trait_impl { AnnotationKind :: Prohibited } else { AnnotationKind :: Required } ;
432
429
self . annotate (
433
430
ii. hir_id ( ) ,
434
- & ii. attrs ,
435
431
ii. span ,
436
432
kind,
437
433
InheritDeprecation :: Yes ,
@@ -446,7 +442,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
446
442
fn visit_variant ( & mut self , var : & ' tcx Variant < ' tcx > , g : & ' tcx Generics < ' tcx > , item_id : HirId ) {
447
443
self . annotate (
448
444
var. id ,
449
- & var. attrs ,
450
445
var. span ,
451
446
AnnotationKind :: Required ,
452
447
InheritDeprecation :: Yes ,
@@ -456,7 +451,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
456
451
if let Some ( ctor_hir_id) = var. data . ctor_hir_id ( ) {
457
452
v. annotate (
458
453
ctor_hir_id,
459
- & var. attrs ,
460
454
var. span ,
461
455
AnnotationKind :: Required ,
462
456
InheritDeprecation :: Yes ,
@@ -474,7 +468,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
474
468
fn visit_struct_field ( & mut self , s : & ' tcx StructField < ' tcx > ) {
475
469
self . annotate (
476
470
s. hir_id ,
477
- & s. attrs ,
478
471
s. span ,
479
472
AnnotationKind :: Required ,
480
473
InheritDeprecation :: Yes ,
@@ -489,7 +482,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
489
482
fn visit_foreign_item ( & mut self , i : & ' tcx hir:: ForeignItem < ' tcx > ) {
490
483
self . annotate (
491
484
i. hir_id ( ) ,
492
- & i. attrs ,
493
485
i. span ,
494
486
AnnotationKind :: Required ,
495
487
InheritDeprecation :: Yes ,
@@ -504,7 +496,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
504
496
fn visit_macro_def ( & mut self , md : & ' tcx hir:: MacroDef < ' tcx > ) {
505
497
self . annotate (
506
498
md. hir_id ( ) ,
507
- & md. attrs ,
508
499
md. span ,
509
500
AnnotationKind :: Required ,
510
501
InheritDeprecation :: Yes ,
@@ -525,7 +516,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Annotator<'a, 'tcx> {
525
516
526
517
self . annotate (
527
518
p. hir_id ,
528
- & p. attrs ,
529
519
p. span ,
530
520
kind,
531
521
InheritDeprecation :: No ,
@@ -696,7 +686,6 @@ fn new_index(tcx: TyCtxt<'tcx>) -> Index<'tcx> {
696
686
697
687
annotator. annotate (
698
688
hir:: CRATE_HIR_ID ,
699
- & krate. item . attrs ,
700
689
krate. item . span ,
701
690
AnnotationKind :: Required ,
702
691
InheritDeprecation :: Yes ,
0 commit comments