mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
fix: resolve alias before resolve variant
This commit is contained in:
parent
cfc959d73a
commit
bd61888b8d
2 changed files with 40 additions and 0 deletions
|
@ -1200,6 +1200,12 @@ impl<'a> InferenceContext<'a> {
|
|||
path: &ModPath,
|
||||
) -> (Ty, Option<VariantId>) {
|
||||
let remaining = unresolved.map(|it| path.segments()[it..].len()).filter(|it| it > &0);
|
||||
let ty = match ty.kind(Interner) {
|
||||
TyKind::Alias(AliasTy::Projection(proj_ty)) => {
|
||||
self.db.normalize_projection(proj_ty.clone(), self.table.trait_env.clone())
|
||||
}
|
||||
_ => ty,
|
||||
};
|
||||
match remaining {
|
||||
None => {
|
||||
let variant = ty.as_adt().and_then(|(adt_id, _)| match adt_id {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue