Skip to content

Commit 765baba

Browse files
committed
rustc: Use tcx.used_crates(()) more
And explain when it should be used.
1 parent 4363278 commit 765baba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ fn item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Vec<Re
647647
/// This function is expensive and should be used sparingly.
648648
pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Vec<Res> {
649649
fn find_crates(tcx: TyCtxt<'_>, name: Symbol) -> impl Iterator<Item = DefId> + '_ {
650-
tcx.crates(())
650+
tcx.crates_including_speculative(())
651651
.iter()
652652
.copied()
653653
.filter(move |&num| tcx.crate_name(num) == name)

0 commit comments

Comments
 (0)