File tree Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Expand file tree Collapse file tree 1 file changed +1
-25
lines changed Original file line number Diff line number Diff line change 44//! overview of how lints are implemented. 
55
66use  std:: cell:: Cell ; 
7- use  std:: { iter ,   slice} ; 
7+ use  std:: slice; 
88
99use  rustc_data_structures:: fx:: FxIndexMap ; 
1010use  rustc_data_structures:: sync; 
@@ -718,30 +718,6 @@ impl<'tcx> LateContext<'tcx> {
718718        } 
719719    } 
720720
721-     /// Check if a `DefId`'s path matches the given absolute type path usage. 
722-      /// 
723-      /// Anonymous scopes such as `extern` imports are matched with `kw::Empty`; 
724-      /// inherent `impl` blocks are matched with the name of the type. 
725-      /// 
726-      /// Instead of using this method, it is often preferable to instead use 
727-      /// `rustc_diagnostic_item` or a `lang_item`. This is less prone to errors 
728-      /// as paths get invalidated if the target definition moves. 
729-      /// 
730-      /// # Examples 
731-      /// 
732-      /// ```rust,ignore (no context or def id available) 
733-      /// if cx.match_def_path(def_id, &[sym::core, sym::option, sym::Option]) { 
734-      ///     // The given `def_id` is that of an `Option` type 
735-      /// } 
736-      /// ``` 
737-      /// 
738-      /// Used by clippy, but should be replaced by diagnostic items eventually. 
739-      pub  fn  match_def_path ( & self ,  def_id :  DefId ,  path :  & [ Symbol ] )  -> bool  { 
740-         let  names = self . get_def_path ( def_id) ; 
741- 
742-         names. len ( )  == path. len ( )  && iter:: zip ( names,  path) . all ( |( a,  & b) | a == b) 
743-     } 
744- 
745721    /// Gets the absolute path of `def_id` as a vector of `Symbol`. 
746722     /// 
747723     /// # Examples 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments