]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #94911 - jackh726:gats_extended_2, r=compiler-errors
authorbors <bors@rust-lang.org>
Sat, 2 Apr 2022 18:34:26 +0000 (18:34 +0000)
committerbors <bors@rust-lang.org>
Sat, 2 Apr 2022 18:34:26 +0000 (18:34 +0000)
commit8f96ef4bb56f5d905ed89ed569ef97f50731c977
tree2046913b71036b757cbe6b6aa30651e561e07aa8
parentb6a34f35e5d10e69640bce74f613af4aeb2f9ede
parent52b00db2351ca8a6902bcd99bac20408eb09a6c6
Auto merge of #94911 - jackh726:gats_extended_2, r=compiler-errors

Make GATs object safe under generic_associated_types_extended feature

Based on #94869

Let's say we have
```rust
trait StreamingIterator {
    type Item<'a> where Self: 'a;
}
```
And `dyn for<'a> StreamingIterator<Item<'a> = &'a i32>`.

If we ask `(dyn for<'a> StreamingIterator<Item<'a> = &'a i32>): StreamingIterator`, then we have to prove that `for<'x> (&'x i32): Sized`. So, we generate *new* bound vars to subst for the GAT generics.

Importantly, this doesn't fully verify that these are usable and sound.

r? `@nikomatsakis`