Does anyone familiar with the resolver know why
expr_std_path can't resolve type-relative paths? I get an error when trying to use it with
std::pin::Pin::new_unchecked (works fine with e.g.
std::ops::Try::into_result, but that's an associated method of a trait, not a type)
Is this limitation fundamental? My temporary workaround plan is to introduce an unstable feature-gated fn
std::pin::new_unchecked and call that instead, but I'd prefer to avoid introducing hacks if unnecessary.
ping-- anyone know about this? maybe @Vadim Petrochenkov ?
expr_std_path is a module-relative resolution thing.
It's too early to resolve type-relative paths at that point.
You can actually make a partially resolved path during lowering and put it into HIR.
And it will be resolved during type checking.
std::pin::Pin can be fed to
std_path, then the last segment added as
ExprKind::Range desugaring works that way already.
std::ops::Try::into_result is module-relative because traits and enums are modules in the eyes of name resolution.)