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

use equality in the coerce-unsized check #41937

Merged

Conversation

nikomatsakis
Copy link
Contributor

@nikomatsakis nikomatsakis commented May 12, 2017

This seems both to be a safe, conservative choice, and it sidesteps the cycle in #41849. Note that, before I converted variance into proper queries, we were using a hybrid of subtyping and equality, due to the presence of a flag that forced invariance if variance had not yet been computed. (Also, Coerce Unsized is unstable.)

Fixes #41936.

r? @eddyb

@nikomatsakis nikomatsakis force-pushed the issue-41936-variance-coerce-unsized-cycle branch from 36717ea to 138a4c8 Compare May 12, 2017 09:50
@arielb1
Copy link
Contributor

arielb1 commented May 12, 2017

Is there even an example that needs subtyping there?

@eddyb
Copy link
Member

eddyb commented May 12, 2017

@arielb1 No, I just used that in the original implementation without realizing the implications.

@bors r+

@bors
Copy link
Contributor

bors commented May 12, 2017

📌 Commit 138a4c8 has been approved by eddyb

Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 12, 2017
…oerce-unsized-cycle, r=eddyb

use equality in the coerce-unsized check

This seems both to be a safe, conservative choice, and it sidesteps the cycle in rust-lang#41849. Note that, before I converted variance into proper queries, we were using a hybrid of subtyping and equality, due to the presence of a flag that forced invariance if variance had not yet been computed. (Also, Coerce Unsized is unstable.)

Fixes rust-lang#41936.

r? @eddyb
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 12, 2017
…oerce-unsized-cycle, r=eddyb

use equality in the coerce-unsized check

This seems both to be a safe, conservative choice, and it sidesteps the cycle in rust-lang#41849. Note that, before I converted variance into proper queries, we were using a hybrid of subtyping and equality, due to the presence of a flag that forced invariance if variance had not yet been computed. (Also, Coerce Unsized is unstable.)

Fixes rust-lang#41936.

r? @eddyb
@nikomatsakis
Copy link
Contributor Author

@Mark-Simulacrum note that travis seems to not like this; I don't have time to fix just now (boarding a plane), but you may want to pull it out of your rollup. =) It looks like the fix didn't work, but that's odd, as I don't see that locally.

@Mark-Simulacrum
Copy link
Member

@bors r-

@shepmaster shepmaster added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label May 12, 2017
This seems both to be a safe, conservative choice,
and it sidesteps the cycle in rust-lang#41936.

Fixes rust-lang#41936.
@nikomatsakis nikomatsakis force-pushed the issue-41936-variance-coerce-unsized-cycle branch from 138a4c8 to 6db4beb Compare May 15, 2017 21:36
@nikomatsakis
Copy link
Contributor Author

ok, I think I found the problem, it was an interaction between this PR and another PR that had merged (but wasn't in my local repo, hence the disparity in the results).

re-r? @eddyb

@eddyb
Copy link
Member

eddyb commented May 16, 2017

@bors r+

@bors
Copy link
Contributor

bors commented May 16, 2017

📌 Commit 6db4beb has been approved by eddyb

@nikomatsakis nikomatsakis 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 16, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request May 16, 2017
…oerce-unsized-cycle, r=eddyb

use equality in the coerce-unsized check

This seems both to be a safe, conservative choice, and it sidesteps the cycle in rust-lang#41849. Note that, before I converted variance into proper queries, we were using a hybrid of subtyping and equality, due to the presence of a flag that forced invariance if variance had not yet been computed. (Also, Coerce Unsized is unstable.)

Fixes rust-lang#41936.

r? @eddyb
bors added a commit that referenced this pull request May 17, 2017
Rollup of 5 pull requests

- Successful merges: #41937, #41957, #42017, #42039, #42046
- Failed merges:
@bors bors merged commit 6db4beb into rust-lang:master May 17, 2017
@arielb1 arielb1 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 18, 2017
@brson
Copy link
Contributor

brson commented May 23, 2017

Does not cherry-pick cleanly cc @nikomatsakis

@nikomatsakis nikomatsakis added the beta-accepted Accepted for backporting to the compiler in the beta channel. label May 23, 2017
@nikomatsakis
Copy link
Contributor Author

Approving for beta. Will backport. cc @rust-lang/compiler

@nikomatsakis nikomatsakis mentioned this pull request May 23, 2017
bors added a commit that referenced this pull request May 24, 2017
Beta backports

Backports of:

- #41913 (or some of it)
- #41937
- #41716
- #41563
@brson brson removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 30, 2017
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Apr 16, 2024
…mpiler-errors

Prefer identity equality over equating types during coercion.

These types are always generic only over their own generic parameters with no inference variables involved.

r? `@compiler-errors`

I love touching code that [hasn't changed meaningfully since 2016](rust-lang#41937)
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 17, 2024
Rollup merge of rust-lang#124027 - oli-obk:define_opaque_types9, r=compiler-errors

Prefer identity equality over equating types during coercion.

These types are always generic only over their own generic parameters with no inference variables involved.

r? `@compiler-errors`

I love touching code that [hasn't changed meaningfully since 2016](rust-lang#41937)
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Apr 17, 2024
…rors

Prefer identity equality over equating types during coercion.

These types are always generic only over their own generic parameters with no inference variables involved.

r? `@compiler-errors`

I love touching code that [hasn't changed meaningfully since 2016](rust-lang/rust#41937)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.

7 participants