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

Account for opaque variance for region outlives and liveness. #106729

Closed
wants to merge 1 commit into from

Conversation

cjgillot
Copy link
Contributor

Should fix #106332

I did not manage to extract a MCVE, so I don't have a test yet.

Putting this up for review in the mean time.

@rustbot
Copy link
Collaborator

rustbot commented Jan 11, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 11, 2023
@compiler-errors
Copy link
Member

compiler-errors commented Jan 12, 2023

I'm a bit worried about beta branching soon.

Perhaps someone from @rust-lang/types can give this a review, ideally we'd have it looked at before T-compiler meeting tomorrow, as this should probably be backported.

I will alternatively prepare a revert for #105255, which should be backported instead if this one can't make it then.

Comment on lines +514 to +518
let variance = if let Some(variances) = opt_variances {
variances[index]
} else {
ty::Invariant
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment that we only need to do this for lifetimes and not type substs, because this is only used for opaque types, which only generate interesting variance for lifetimes, not type parameters

@oli-obk oli-obk added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 12, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Jan 12, 2023

r? @oli-obk

@rustbot rustbot assigned oli-obk and unassigned wesleywiser Jan 12, 2023
@apiraino
Copy link
Contributor

Beta backport declined as per compiler team on Zulip in favor #106759

@rustbot label -beta-nominated

@rustbot rustbot removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 12, 2023
JohnTitor pushed a commit to JohnTitor/rust that referenced this pull request Jan 12, 2023
…jgillot

Revert "Make nested RPITIT inherit the parent opaque's generics."

This reverts commit e2d41f4, and adjusts the `tests/ui/async-await/in-trait/nested-rpit.rs` test.

r? `@cjgillot`

fixes rust-lang#106332, manually verified because it had no minimization :/

reopens rust-lang#105197
cc rust-lang#106729
@bors
Copy link
Contributor

bors commented Jan 19, 2023

☔ The latest upstream changes (presumably #106910) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member

Any chance this could get rebased (with #105255 un-reverted)? It would fix #108580.

@oli-obk oli-obk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 19, 2023
@cjgillot cjgillot closed this Aug 4, 2023
@cjgillot cjgillot deleted the borrowck-variance branch August 4, 2023 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Borrow checker error on nightly even when the type is 'static
7 participants