diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-05-10 17:29:02 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-05-22 18:02:51 +0300 |
| commit | 765baba165adb0ce0bef398f5eed54ba97d638f3 (patch) | |
| tree | 09e52226885c4cdfc4cc816734499702e41b98d5 | |
| parent | 4363278c73cf506f71215e9e21af90e31c4d74ea (diff) | |
| download | rust-765baba165adb0ce0bef398f5eed54ba97d638f3.tar.gz rust-765baba165adb0ce0bef398f5eed54ba97d638f3.zip | |
rustc: Use `tcx.used_crates(())` more
And explain when it should be used.
| -rw-r--r-- | clippy_utils/src/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_utils/src/lib.rs b/clippy_utils/src/lib.rs index 4c603bda770..94d4656377f 100644 --- a/clippy_utils/src/lib.rs +++ b/clippy_utils/src/lib.rs @@ -647,7 +647,7 @@ fn item_children_by_name(tcx: TyCtxt<'_>, def_id: DefId, name: Symbol) -> Vec<Re /// This function is expensive and should be used sparingly. pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Vec<Res> { fn find_crates(tcx: TyCtxt<'_>, name: Symbol) -> impl Iterator<Item = DefId> + '_ { - tcx.crates(()) + tcx.crates_including_speculative(()) .iter() .copied() .filter(move |&num| tcx.crate_name(num) == name) |
