File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -3531,10 +3531,10 @@ impl<'hir> FnRetTy<'hir> {
35313531    } 
35323532
35333533    pub  fn  is_suggestable_infer_ty ( & self )  -> Option < & ' hir  Ty < ' hir > >  { 
3534-         if  let  Self :: Return ( ty)  = self   { 
3535-             if  ty. is_suggestable_infer_ty ( )   { 
3536-                  return   Some ( * ty ) ; 
3537-             } 
3534+         if  let  Self :: Return ( ty)  = self 
3535+             &&  ty. is_suggestable_infer_ty ( ) 
3536+         { 
3537+             return   Some ( * ty ) ; 
35383538        } 
35393539        None 
35403540    } 
@@ -4409,16 +4409,14 @@ impl<'hir> Node<'hir> {
44094409
44104410    /// Get a `hir::Impl` if the node is an impl block for the given `trait_def_id`. 
44114411     pub  fn  impl_block_of_trait ( self ,  trait_def_id :  DefId )  -> Option < & ' hir  Impl < ' hir > >  { 
4412-         match  self  { 
4413-             Node :: Item ( Item  {  kind :  ItemKind :: Impl ( impl_block) ,  .. } ) 
4414-                 if  impl_block
4415-                     . of_trait 
4416-                     . and_then ( |trait_ref| trait_ref. trait_def_id ( ) ) 
4417-                     . is_some_and ( |trait_id| trait_id == trait_def_id)  =>
4418-             { 
4419-                 Some ( impl_block) 
4420-             } 
4421-             _ => None , 
4412+         if  let  Node :: Item ( Item  {  kind :  ItemKind :: Impl ( impl_block) ,  .. } )  = self 
4413+             && let  Some ( trait_ref)  = impl_block. of_trait 
4414+             && let  Some ( trait_id)  = trait_ref. trait_def_id ( ) 
4415+             && trait_id == trait_def_id
4416+         { 
4417+             Some ( impl_block) 
4418+         }  else  { 
4419+             None 
44224420        } 
44234421    } 
44244422
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments