@@ -3,7 +3,6 @@ use crate::def_id::DefId;
33crate use crate :: hir_id:: HirId ;
44use crate :: { itemlikevisit, LangItem } ;
55
6- use rustc_ast:: node_id:: NodeMap ;
76use rustc_ast:: util:: parser:: ExprPrecedence ;
87use rustc_ast:: { self as ast, CrateSugar , LlvmAsmDialect } ;
98use rustc_ast:: { AttrVec , Attribute , FloatTy , IntTy , Label , LitKind , StrStyle , UintTy } ;
@@ -306,10 +305,6 @@ impl GenericArgs<'_> {
306305 Self { args : & [ ] , bindings : & [ ] , parenthesized : false }
307306 }
308307
309- pub fn is_empty ( & self ) -> bool {
310- self . args . is_empty ( ) && self . bindings . is_empty ( ) && !self . parenthesized
311- }
312-
313308 pub fn inputs ( & self ) -> & [ Ty < ' _ > ] {
314309 if self . parenthesized {
315310 for arg in self . args {
@@ -467,23 +462,6 @@ impl Generics<'hir> {
467462 }
468463 }
469464
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-
487465 pub fn get_named ( & self , name : Symbol ) -> Option < & GenericParam < ' _ > > {
488466 for param in self . params {
489467 if name == param. name . ident ( ) . name {
@@ -2679,8 +2657,6 @@ pub struct Upvar {
26792657 pub span : Span ,
26802658}
26812659
2682- pub type CaptureModeMap = NodeMap < CaptureBy > ;
2683-
26842660// The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
26852661// has length > 0 if the trait is found through an chain of imports, starting with the
26862662// import/use statement in the scope where the trait is used.
@@ -2766,32 +2742,4 @@ impl<'hir> Node<'hir> {
27662742 _ => None ,
27672743 }
27682744 }
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- }
27972745}
0 commit comments