-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make GATs object safe under generic_associated_types_extended feature #94911
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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)
ObjectSafetyViolation::GAT(ident.name, ident.span) | ||
}), | ||
); | ||
if !tcx.features().generic_associated_types_extended { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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