@@ -91,15 +91,14 @@ use std::hash::BuildHasherDefault;
91
91
use std:: iter:: { once, repeat} ;
92
92
use std:: sync:: { Mutex , MutexGuard , OnceLock } ;
93
93
94
- use clippy_config:: types:: DisallowedPath ;
95
94
use itertools:: Itertools ;
96
95
use rustc_ast:: ast:: { self , LitKind , RangeLimits } ;
97
96
use rustc_data_structures:: fx:: FxHashMap ;
98
97
use rustc_data_structures:: packed:: Pu128 ;
99
98
use rustc_data_structures:: unhash:: UnhashMap ;
100
99
use rustc_hir:: LangItem :: { OptionNone , OptionSome , ResultErr , ResultOk } ;
101
100
use 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 } ;
103
102
use rustc_hir:: definitions:: { DefPath , DefPathData } ;
104
103
use rustc_hir:: hir_id:: { HirIdMap , HirIdSet } ;
105
104
use rustc_hir:: intravisit:: { FnKind , Visitor , walk_expr} ;
@@ -750,18 +749,6 @@ pub fn def_path_def_ids(tcx: TyCtxt<'_>, path: &[&str]) -> impl Iterator<Item =
750
749
def_path_res ( tcx, path) . into_iter ( ) . filter_map ( |res| res. opt_def_id ( ) )
751
750
}
752
751
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
-
765
752
/// Convenience function to get the `DefId` of a trait by path.
766
753
/// It could be a trait or trait alias.
767
754
///
0 commit comments