File tree 1 file changed +4
-12
lines changed
compiler/rustc_middle/src/ty
1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -2897,19 +2897,11 @@ impl<'tcx> TyCtxt<'tcx> {
2897
2897
}
2898
2898
2899
2899
pub fn opt_associated_item ( self , def_id : DefId ) -> Option < & ' tcx AssocItem > {
2900
- let is_associated_item = if let Some ( def_id) = def_id. as_local ( ) {
2901
- matches ! (
2902
- self . hir( ) . get( self . hir( ) . local_def_id_to_hir_id( def_id) ) ,
2903
- Node :: TraitItem ( _) | Node :: ImplItem ( _)
2904
- )
2900
+ if let DefKind :: AssocConst | DefKind :: AssocFn | DefKind :: AssocTy = self . def_kind ( def_id) {
2901
+ Some ( self . associated_item ( def_id) )
2905
2902
} else {
2906
- matches ! (
2907
- self . def_kind( def_id) ,
2908
- DefKind :: AssocConst | DefKind :: AssocFn | DefKind :: AssocTy
2909
- )
2910
- } ;
2911
-
2912
- is_associated_item. then ( || self . associated_item ( def_id) )
2903
+ None
2904
+ }
2913
2905
}
2914
2906
2915
2907
pub fn field_index ( self , hir_id : hir:: HirId , typeck_results : & TypeckResults < ' _ > ) -> usize {
You can’t perform that action at this time.
0 commit comments