Make GATs object safe under generic_associated_types_extended feature#94911
Make GATs object safe under generic_associated_types_extended feature#94911bors merged 1 commit intorust-lang:masterfrom
Conversation
This comment has been minimized.
This comment has been minimized.
df561d2 to
8265592
Compare
|
☔ The latest upstream changes (presumably #95291) made this pull request unmergeable. Please resolve the merge conflicts. |
8265592 to
a05d895
Compare
This comment has been minimized.
This comment has been minimized.
a05d895 to
b5e2d63
Compare
There was a problem hiding this comment.
these changes look good -- the logic you're using to create new bound vars for the GATs is inspired from #87900, right?
r=me once the parent PR lands (and you rebase that first commit out)
There was a problem hiding this comment.
I was going to say that this should also deny GATs with type parameters, but it seems we already disallow those elsewhere: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1af97ded49aa74d43f72f0c3b70658e9
|
☔ The latest upstream changes (presumably #95501) made this pull request unmergeable. Please resolve the merge conflicts. |
b5e2d63 to
d3fe28b
Compare
|
@bors r=compiler-errors |
|
📌 Commit d3fe28b has been approved by |
…r-errors Make GATs object safe under generic_associated_types_extended feature Based on rust-lang#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`
|
NLL strikes again... |
d3fe28b to
52b00db
Compare
|
@bors r=compiler-errors |
|
📌 Commit 52b00db has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (8f96ef4): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Based on #94869
Let's say we have
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 thatfor<'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