Function clippy_utils::def_path_res
source · pub fn def_path_res(cx: &LateContext<'_>, path: &[&str]) -> Vec<Res>
Expand description
Resolves a def path like std::vec::Vec
.
Can return multiple resolutions when there are multiple versions of the same crate, e.g.
memchr::memchr
could return the functions from both memchr 1.0 and memchr 2.0.
Also returns multiple results when there are multiple paths under the same name e.g. std::vec
would have both a DefKind::Mod
and DefKind::Macro
.
This function is expensive and should be used sparingly.