diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-08-06 20:23:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-06 20:23:39 +0200 |
| commit | 333c63b9fcf47ad8f8ea7c5e529258afaadc17a4 (patch) | |
| tree | 6f27d0578870eb4ff343a1d43d4a9680664a31ba /compiler/rustc_codegen_llvm/src | |
| parent | d3d9aae96076c78b9d1b557475ecad146cb588a0 (diff) | |
| parent | 3d5bd95558a0a6beb48531eea60994c694208b4a (diff) | |
| download | rust-333c63b9fcf47ad8f8ea7c5e529258afaadc17a4.tar.gz rust-333c63b9fcf47ad8f8ea7c5e529258afaadc17a4.zip | |
Rollup merge of #128377 - veera-sivarajan:fix-128249, r=davidtwco
Fix ICE Caused by Incorrectly Delaying E0107
Fixes #128249
For the following code:
```rust
trait Foo<T> {}
impl Foo<T: Default> for u8 {}
```
#126054 added some logic to delay emitting E0107 as the names of associated type `T` in the impl header and generic parameter `T` in `trait Foo` match.
But it failed to ensure whether such unexpected associated type bounds are coming from a impl block header. This caused an ICE as the compiler was delaying E0107 for code like:
```rust
trait Trait<Type> {
type Type;
fn method(&self) -> impl Trait<Type: '_>;
}
```
because it assumed the associated type bound `Type: '_` is for the generic parameter `Type` in `trait Trait` since the names are same.
This PR adds a check to ensure that E0107 is delayed only in the context of impl block header.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
