-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Allow Trait inheritance with cycles on associated types #79209
Conversation
d6983e5
to
75a1a97
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.
I thought I had some good creative ideas for tests but as I look at it, most of them are kind of the same as the tests you already have.
I guess I think we should test some scenarios that ARE still ambiguous, e.g.
trait Foo { type Item; }
trait Bar<T> { type Item; }
trait Baz: Foo + Bar<Self::Item> { }
/// Ensures that the super-predicates of the trait with a `DefId` | ||
/// of `trait_def_id` are converted and stored. This also ensures that | ||
/// the transitive super-predicates are converted. | ||
fn super_predicates_that_define_assoc_type( |
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.
Hmm so this is a query... it's a bit unusual in that most query providers either operate on local def-ids or external def-ids but not both. (The typical strategy, in other words, would be to define this query by encoding it into the metadata.) But that seems kind of silly here, I don't see a reason to encode more into the metadata. So this setup is probably ok. But I feel like we have to be sure to setup the provider also for external crates or we will see ICEs -- I'm a bit surprised our tests aren't encountering them yet, actually.
7ce0390
to
3be4aaf
Compare
☔ The latest upstream changes (presumably #79345) made this pull request unmergeable. Please resolve the merge conflicts. Note that reviewers usually do not review pull requests until merge conflicts are resolved! Once you resolve the conflicts, you should change the labels applied by bors to indicate that your PR is ready for review. Post this as a comment to change the labels:
|
34c5526
to
1401166
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.
Can you add a test like
trait Foo<T> { }
trait Bar { type A; type B; }
trait Baz: Bar<B = u32> + Foo<Self::A> { }
I want to be sure that we correctly handle predicates like Bar<B = u32>
, which can also define an assoc type (A
, in this case)
dff76fa
to
50d7360
Compare
74dfa1e
to
8ac093a
Compare
8ac093a
to
84f6b86
Compare
@bors r+ |
📌 Commit 84f6b861433e61ab0de27980a9b9266ca4fff1ac has been approved by |
@bors rollup=never |
⌛ Testing commit 84f6b861433e61ab0de27980a9b9266ca4fff1ac with merge 4c9eee42b3766d927e66c92c378b3d55a7f3023f... |
💔 Test failed - checks-actions |
@bors retry |
@bors r+ |
📌 Commit ada7c1f has been approved by |
⌛ Testing commit ada7c1f with merge 60e4bbf0e17aa931e8b32579c31da2024d5e9890... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
…elf, r=Mark-Simulacrum Revert "Auto merge of rust-lang#79209 r? `@nikomatsakis` This has caused some issues (rust-lang#79560) so better to revert and try to come up with a proper fix without rush.
@spastorino FYI: there was a minor perf regression from this PR. I'm still getting used to telling whether something is noise, but a 2% change on packed-simd seems like it's probably an actual regression (albeit a small one). edit: just noticed this was reverted in #79637 |
… r=nikomatsakis Allow Trait inheritance with cycles on associated types take 2 This reverts the revert of rust-lang#79209 and fixes the ICEs that's occasioned by that PR exposing some problems that are addressed in rust-lang#80648 and rust-lang#79811. For easier review I'd say, check only the last commit, the first one is just a revert of the revert of rust-lang#79209 which was already approved. This also could be considered part or the actual fix of rust-lang#79560 but I guess for that to be closed and fixed completely we would need to land rust-lang#80648 and rust-lang#79811 too. r? `@nikomatsakis` cc `@Aaron1011`
… r=nikomatsakis Allow Trait inheritance with cycles on associated types take 2 This reverts the revert of rust-lang#79209 and fixes the ICEs that's occasioned by that PR exposing some problems that are addressed in rust-lang#80648 and rust-lang#79811. For easier review I'd say, check only the last commit, the first one is just a revert of the revert of rust-lang#79209 which was already approved. This also could be considered part or the actual fix of rust-lang#79560 but I guess for that to be closed and fixed completely we would need to land rust-lang#80648 and rust-lang#79811 too. r? `@nikomatsakis` cc `@Aaron1011`
Fixes #35237
r? @nikomatsakis
cc @estebank