@@ -91,15 +91,14 @@ use std::hash::BuildHasherDefault;
9191use std:: iter:: { once, repeat} ;
9292use std:: sync:: { Mutex , MutexGuard , OnceLock } ;
9393
94- use clippy_config:: types:: DisallowedPath ;
9594use itertools:: Itertools ;
9695use rustc_ast:: ast:: { self , LitKind , RangeLimits } ;
9796use rustc_data_structures:: fx:: FxHashMap ;
9897use rustc_data_structures:: packed:: Pu128 ;
9998use rustc_data_structures:: unhash:: UnhashMap ;
10099use rustc_hir:: LangItem :: { OptionNone , OptionSome , ResultErr , ResultOk } ;
101100use rustc_hir:: def:: { DefKind , Res } ;
102- use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , LOCAL_CRATE , LocalDefId , LocalModDefId } ;
101+ use rustc_hir:: def_id:: { CrateNum , DefId , LOCAL_CRATE , LocalDefId , LocalModDefId } ;
103102use rustc_hir:: definitions:: { DefPath , DefPathData } ;
104103use rustc_hir:: hir_id:: { HirIdMap , HirIdSet } ;
105104use rustc_hir:: intravisit:: { FnKind , Visitor , walk_expr} ;
@@ -750,18 +749,6 @@ pub fn def_path_def_ids(tcx: TyCtxt<'_>, path: &[&str]) -> impl Iterator<Item =
750749 def_path_res ( tcx, path) . into_iter ( ) . filter_map ( |res| res. opt_def_id ( ) )
751750}
752751
753- /// Creates a map of disallowed items to the reason they were disallowed.
754- pub fn create_disallowed_map (
755- tcx : TyCtxt < ' _ > ,
756- disallowed : & ' static [ DisallowedPath ] ,
757- ) -> DefIdMap < ( & ' static str , Option < & ' static str > ) > {
758- disallowed
759- . iter ( )
760- . map ( |x| ( x. path ( ) , x. path ( ) . split ( "::" ) . collect :: < Vec < _ > > ( ) , x. reason ( ) ) )
761- . flat_map ( |( name, path, reason) | def_path_def_ids ( tcx, & path) . map ( move |id| ( id, ( name, reason) ) ) )
762- . collect ( )
763- }
764-
765752/// Convenience function to get the `DefId` of a trait by path.
766753/// It could be a trait or trait alias.
767754///
0 commit comments