pub fn def_path_def_ids<'a, 'tcx>(
s: &impl BaseState<'tcx>,
path: &'a [&'a str],
) -> Result<Vec<DefId>, &'a [&'a str]>
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.
If the path does not correspond to an existing item, return the first subpath that doesn’t correspond to an item.