@@ -3,7 +3,6 @@ use crate::def_id::DefId;
3
3
crate use crate :: hir_id:: HirId ;
4
4
use crate :: { itemlikevisit, LangItem } ;
5
5
6
- use rustc_ast:: node_id:: NodeMap ;
7
6
use rustc_ast:: util:: parser:: ExprPrecedence ;
8
7
use rustc_ast:: { self as ast, CrateSugar , LlvmAsmDialect } ;
9
8
use rustc_ast:: { AttrVec , Attribute , FloatTy , IntTy , Label , LitKind , StrStyle , UintTy } ;
@@ -306,10 +305,6 @@ impl GenericArgs<'_> {
306
305
Self { args : & [ ] , bindings : & [ ] , parenthesized : false }
307
306
}
308
307
309
- pub fn is_empty ( & self ) -> bool {
310
- self . args . is_empty ( ) && self . bindings . is_empty ( ) && !self . parenthesized
311
- }
312
-
313
308
pub fn inputs ( & self ) -> & [ Ty < ' _ > ] {
314
309
if self . parenthesized {
315
310
for arg in self . args {
@@ -467,23 +462,6 @@ impl Generics<'hir> {
467
462
}
468
463
}
469
464
470
- pub fn own_counts ( & self ) -> GenericParamCount {
471
- // We could cache this as a property of `GenericParamCount`, but
472
- // the aim is to refactor this away entirely eventually and the
473
- // presence of this method will be a constant reminder.
474
- let mut own_counts: GenericParamCount = Default :: default ( ) ;
475
-
476
- for param in self . params {
477
- match param. kind {
478
- GenericParamKind :: Lifetime { .. } => own_counts. lifetimes += 1 ,
479
- GenericParamKind :: Type { .. } => own_counts. types += 1 ,
480
- GenericParamKind :: Const { .. } => own_counts. consts += 1 ,
481
- } ;
482
- }
483
-
484
- own_counts
485
- }
486
-
487
465
pub fn get_named ( & self , name : Symbol ) -> Option < & GenericParam < ' _ > > {
488
466
for param in self . params {
489
467
if name == param. name . ident ( ) . name {
@@ -2679,8 +2657,6 @@ pub struct Upvar {
2679
2657
pub span : Span ,
2680
2658
}
2681
2659
2682
- pub type CaptureModeMap = NodeMap < CaptureBy > ;
2683
-
2684
2660
// The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
2685
2661
// has length > 0 if the trait is found through an chain of imports, starting with the
2686
2662
// import/use statement in the scope where the trait is used.
@@ -2766,32 +2742,4 @@ impl<'hir> Node<'hir> {
2766
2742
_ => None ,
2767
2743
}
2768
2744
}
2769
-
2770
- pub fn hir_id ( & self ) -> Option < HirId > {
2771
- match self {
2772
- Node :: Item ( Item { hir_id, .. } )
2773
- | Node :: ForeignItem ( ForeignItem { hir_id, .. } )
2774
- | Node :: TraitItem ( TraitItem { hir_id, .. } )
2775
- | Node :: ImplItem ( ImplItem { hir_id, .. } )
2776
- | Node :: Field ( StructField { hir_id, .. } )
2777
- | Node :: AnonConst ( AnonConst { hir_id, .. } )
2778
- | Node :: Expr ( Expr { hir_id, .. } )
2779
- | Node :: Stmt ( Stmt { hir_id, .. } )
2780
- | Node :: Ty ( Ty { hir_id, .. } )
2781
- | Node :: Binding ( Pat { hir_id, .. } )
2782
- | Node :: Pat ( Pat { hir_id, .. } )
2783
- | Node :: Arm ( Arm { hir_id, .. } )
2784
- | Node :: Block ( Block { hir_id, .. } )
2785
- | Node :: Local ( Local { hir_id, .. } )
2786
- | Node :: MacroDef ( MacroDef { hir_id, .. } )
2787
- | Node :: Lifetime ( Lifetime { hir_id, .. } )
2788
- | Node :: Param ( Param { hir_id, .. } )
2789
- | Node :: GenericParam ( GenericParam { hir_id, .. } ) => Some ( * hir_id) ,
2790
- Node :: TraitRef ( TraitRef { hir_ref_id, .. } ) => Some ( * hir_ref_id) ,
2791
- Node :: PathSegment ( PathSegment { hir_id, .. } ) => * hir_id,
2792
- Node :: Variant ( Variant { id, .. } ) => Some ( * id) ,
2793
- Node :: Ctor ( variant) => variant. ctor_hir_id ( ) ,
2794
- Node :: Crate ( _) | Node :: Visibility ( _) => None ,
2795
- }
2796
- }
2797
2745
}
0 commit comments