about summary refs log tree commit diff
path: root/tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-05 10:47:47 +0000
committerbors <bors@rust-lang.org>2023-04-05 10:47:47 +0000
commitaf306567858b9456870d33963673d4711dff9ec2 (patch)
tree5118ca4de4baea86701f7763aa4cdd73814da1e5 /tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff
parenta6464392c15fa8788215d669c4c0b1e46bcadeea (diff)
parent6447d485e3765c20295368ac3503ed18b041298f (diff)
downloadrust-af306567858b9456870d33963673d4711dff9ec2.tar.gz
rust-af306567858b9456870d33963673d4711dff9ec2.zip
Auto merge of #14436 - lowr:patch/normalize-assoc-type-in-path-expr, r=HKalbasi
Normalize associated types in paths in expressions

Part of #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 #14393 to be currently broken.
Diffstat (limited to 'tests/mir-opt/lower_array_len.array_len.NormalizeArrayLen.panic-unwind.diff')
0 files changed, 0 insertions, 0 deletions