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 miscompilation when calling default methods on Future #111354

Merged
merged 1 commit into from
May 8, 2023
Merged

Fix miscompilation when calling default methods on Future #111354

merged 1 commit into from
May 8, 2023

Conversation

jonas-schievink
Copy link
Contributor

In #111264 I discovered a lingering miscompilation when calling a default method on Future (none currently exist). #111279 added a debug assertion, which sadly doesn't help much since to my knowledge stage0 is not built with them enabled, and it still doesn't make default methods work like they should.

This PR fixes resolve_instance to resolve default methods on Future correctly, allowing library contributors to add Future combinators without running into ICEs or miscompilations. I've tested this as part of #111347, but no test is included here (assuming that future methods include their own tests that would cover this sufficiently).

r? @compiler-errors

@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 May 8, 2023
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Squash this into one commit, then r=me

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 8, 2023

📌 Commit 3bbb69e has been approved by compiler-errors

It is now in the queue for this repository.

@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 8, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 8, 2023
…mpiler-errors

Rollup of 6 pull requests

Successful merges:

 - rust-lang#104070 (Prevent aborting guard from aborting the process in a forced unwind)
 - rust-lang#109410 (Introduce `AliasKind::Inherent` for inherent associated types)
 - rust-lang#111004 (Migrate `mir_transform` to translatable diagnostics)
 - rust-lang#111118 (Suggest struct when we get colon in fileds in enum)
 - rust-lang#111170 (Diagnostic args are still args if they're documented)
 - rust-lang#111354 (Fix miscompilation when calling default methods on `Future`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bbea63f into rust-lang:master May 8, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 8, 2023
@jonas-schievink jonas-schievink deleted the enable-future-combinators branch May 9, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

4 participants