Skip to content
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

require gat substs to be invariant #80558

Merged
merged 1 commit into from
Jan 22, 2021
Merged

require gat substs to be invariant #80558

merged 1 commit into from
Jan 22, 2021

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Dec 31, 2020

fixes #69184, fixes #80766

r? @matthewjasper probably

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 31, 2020
@lcnr lcnr added the F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs label Dec 31, 2020
@rust-log-analyzer

This comment has been minimized.

// When dealing with generic associated types we require
// their generic arguments to be invariant.
let gat_substs = &data.substs[trait_ref.substs.len()..];
self.add_constraints_from_invariant_substs(current, gat_substs, variance);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that calling add_constraints_from_invariant_substs directly on all of the substs makes more sense here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think so too, should have spend some time actually looking at add_constraints_for_trait_ref

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 21, 2021

📌 Commit 5d641b649b1b0f5b4595914a63de111b996794be has been approved by matthewjasper

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 21, 2021
@lcnr
Copy link
Contributor Author

lcnr commented Jan 21, 2021

removed some unnecessary changes

@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jan 22, 2021

📌 Commit f32a6ac has been approved by matthewjasper

@bors
Copy link
Contributor

bors commented Jan 22, 2021

⌛ Testing commit f32a6ac with merge bbc01bb...

@bors
Copy link
Contributor

bors commented Jan 22, 2021

☀️ Test successful - checks-actions
Approved by: matthewjasper
Pushing bbc01bb to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 22, 2021
@bors bors merged commit bbc01bb into rust-lang:master Jan 22, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 22, 2021
@lcnr lcnr deleted the gat-variance branch January 22, 2021 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect unused parameter with GAT GAT + enum: incorrect unused lifetime error
6 participants