impl ModPath {
pub fn from_src(path: ast::Path, hygiene: &Hygiene) -> Option<ModPath> {
- lower::lower_path(path, hygiene).map(|it| (*it.mod_path).clone())
+ let ctx = LowerCtx::with_hygiene(hygiene);
+ lower::lower_path(path, &ctx).map(|it| (*it.mod_path).clone())
}
pub fn from_segments(kind: PathKind, segments: impl IntoIterator<Item = Name>) -> ModPath {
impl Path {
/// Converts an `ast::Path` to `Path`. Works with use trees.
/// It correctly handles `$crate` based path from macro call.
- pub fn from_src(path: ast::Path, hygiene: &Hygiene) -> Option<Path> {
- lower::lower_path(path, hygiene)
+ pub fn from_src(path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
+ lower::lower_path(path, ctx)
}
/// Converts a known mod path to `Path`.