1
- use clippy_utils:: PathNS ;
1
+ use clippy_utils:: paths :: { PathNS , find_crates , lookup_path } ;
2
2
use rustc_data_structures:: fx:: FxHashMap ;
3
3
use rustc_errors:: { Applicability , Diag } ;
4
4
use rustc_hir:: PrimTy ;
@@ -148,7 +148,7 @@ pub fn create_disallowed_map<const REPLACEMENT_ALLOWED: bool>(
148
148
for disallowed_path in disallowed_paths {
149
149
let path = disallowed_path. path ( ) ;
150
150
let sym_path: Vec < Symbol > = path. split ( "::" ) . map ( Symbol :: intern) . collect ( ) ;
151
- let mut resolutions = clippy_utils :: lookup_path ( tcx, ns, & sym_path) ;
151
+ let mut resolutions = lookup_path ( tcx, ns, & sym_path) ;
152
152
resolutions. retain ( |& def_id| def_kind_predicate ( tcx. def_kind ( def_id) ) ) ;
153
153
154
154
let ( prim_ty, found_prim_ty) = if let & [ name] = sym_path. as_slice ( )
@@ -164,10 +164,10 @@ pub fn create_disallowed_map<const REPLACEMENT_ALLOWED: bool>(
164
164
&& !disallowed_path. allow_invalid
165
165
// Don't warn about unloaded crates:
166
166
// https://github.com/rust-lang/rust-clippy/pull/14397#issuecomment-2848328221
167
- && ( sym_path. len ( ) < 2 || !clippy_utils :: find_crates ( tcx, sym_path[ 0 ] ) . is_empty ( ) )
167
+ && ( sym_path. len ( ) < 2 || !find_crates ( tcx, sym_path[ 0 ] ) . is_empty ( ) )
168
168
{
169
169
// Relookup the path in an arbitrary namespace to get a good `expected, found` message
170
- let found_def_ids = clippy_utils :: lookup_path ( tcx, PathNS :: Arbitrary , & sym_path) ;
170
+ let found_def_ids = lookup_path ( tcx, PathNS :: Arbitrary , & sym_path) ;
171
171
let message = if let Some ( & def_id) = found_def_ids. first ( ) {
172
172
let ( article, description) = tcx. article_and_description ( def_id) ;
173
173
format ! ( "expected a {predicate_description}, found {article} {description}" )
0 commit comments