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

Fix self referential impl Trait substitutions #50694

Merged
merged 1 commit into from
May 14, 2018

Conversation

leoyvens
Copy link
Contributor

A high impact bug because a lot of common traits use a Self substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov

A high impact bug because a lot of common traits use a `Self`
substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made
more robust.

Fixes rust-lang#49376
Fixes rust-lang#50626

r? @petrochenkov
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 12, 2018
@petrochenkov
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented May 13, 2018

📌 Commit 56bc4c2 has been approved by petrochenkov

@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 May 13, 2018
@bors
Copy link
Contributor

bors commented May 14, 2018

⌛ Testing commit 56bc4c2 with merge 76027ed...

bors added a commit that referenced this pull request May 14, 2018
…r=petrochenkov

Fix self referential impl Trait substitutions

A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov
@bors
Copy link
Contributor

bors commented May 14, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: petrochenkov
Pushing 76027ed to master...

@bors bors merged commit 56bc4c2 into rust-lang:master May 14, 2018
@pietroalbini pietroalbini added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 14, 2018
@pietroalbini
Copy link
Member

@leodasvacas proposed to backport this in #50737. @rust-lang/compiler?

@leoyvens
Copy link
Contributor Author

leoyvens commented May 14, 2018

Justification for backport: Previously impl Trait where Trait is one of PartialEq, PartialOrd, Add, AddAssign (and all other arithmetic traits and their Assign counterparts) would cause a rustc stack overflow when then should in fact work normally, this is caused by the RHS = Self type parameter which caused infinite recursion in the privacy checker. This can cause a bad first impression of the widely advertised impl Trait feature.

@alexcrichton alexcrichton added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels May 15, 2018
bors added a commit that referenced this pull request May 15, 2018
[beta] Process backports

Merged on master:

* #50648: Fix volatile_store and nontemporal_store
* #50735: rustc: don't trip an assertion for enums with present but uninhabited variants.
* #50693: typeck: Save the index of private fields
* #50748: Update stdsimd module
* #50694: Fix self referential impl Trait substitutions

r? @alexcrichton
bors added a commit that referenced this pull request May 25, 2018
Stable point release (1.26.1)

This includes all items on [the wishlist](#50756), plus #50694, which backported cleanly.

The target date is May 29th, Tuesday next week.

cc @rust-lang/compiler @oli-obk @eddyb  -- I backported #50812, but it wasn't a clean patch so review would be appreciated.
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.

6 participants