You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…th-expr, r=HKalbasi
Normalize associated types in paths in expressions
Part of rust-lang#14393
When we resolve paths in expressions (either path expressions or paths in struct expressions), there's a need of projection normalization, which `TyLoweringContext` cannot do on its own. We've been properly applying normalization for paths in struct expressions without type anchor, but not for others:
```rust
enum E {
S { v: i32 }
Empty,
}
impl Foo for Bar {
type Assoc = E;
fn foo() {
let _ = Self::Assoc::S { v: 42 }; // path in struct expr without type anchor; we already support this
let _ = <Self>::Assoc::S { v: 42 }; // path in struct expr with type anchor; resolves with this PR
let _ = Self::Assoc::Empty; // path expr; resolves with this PR
}
}
```
With this PR we correctly resolve the whole path, but we need some more tweaks in HIR and/or IDE layers to properly resolve a qualifier (prefix) of such paths and provide IDE features that are pointed out in rust-lang#14393 to be currently broken.
flip1995
added a commit
to flip1995/rust
that referenced
this issue
Mar 20, 2025
Last part of rust-lang/rust-clippy#11421.
Now all ui tests require annotations.
The change in `ui_test` is to add `ICE:` errors.
changelog: Make internals ui tests annotations mandatory
r? @flip1995
Code:
Output:
The text was updated successfully, but these errors were encountered: