diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-31 16:57:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-31 16:57:55 +0200 |
| commit | 692d764e534871beaa5b379b68788e1dc23a069c (patch) | |
| tree | bdd821981d10c13e722dca5817e88745b2934997 /compiler/rustc_codegen_gcc/src/errors.rs | |
| parent | 95b7116d70ac2cd4c9418ebdca16fc82b52ca890 (diff) | |
| parent | 6f5c51f3f4ab0ffcd1b54979f7ab5926efb2a5f8 (diff) | |
| download | rust-692d764e534871beaa5b379b68788e1dc23a069c.tar.gz rust-692d764e534871beaa5b379b68788e1dc23a069c.zip | |
Rollup merge of #114267 - compiler-errors:rpitit-opaque-bounds, r=spastorino
Map RPITIT's opaque type bounds back from projections to opaques
An RPITIT in a program's AST is eventually translated into both a projection GAT and an opaque. The opaque is used for default trait methods, like:
```
trait Foo {
fn bar() -> impl Sized { 0i32 }
}
```
The item bounds for both the projection and opaque are identical, and both have a *projection* self ty. This is mostly okay, since we can normalize this projection within the default trait method body to the opaque, but it does two things:
1. it leads to bugs in places where we don't normalize item bounds, like `deduce_future_output_from_obligations`
2. it leads to extra match arms that are both suspicious looking and also easy to miss
This PR maps the opaque type bounds of the RPITIT's *opaque* back to the opaque's self type to avoid this quirk. Then we can fix the UI test for #108304 (1.) and also remove a bunch of match arms (2.).
Fixes #108304
r? `@spastorino`
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/errors.rs')
0 files changed, 0 insertions, 0 deletions
