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

Don't install default projection bound for return-position impl Trait in trait methods with no body #113741

Merged

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 16, 2023

This ensures that we never try to project to an opaque type in a trait method that has no body to infer its hidden type, which means we never later call type_of on that opaque. This is because opaque types try to reveal their hidden type when proving auto traits.

I thought about this a lot, and I think this is a fix that's less likely to introduce other strange downstream ICEs than #113461.

Fixes #113434

r? @spastorino

@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 Jul 16, 2023
@compiler-errors compiler-errors changed the title Don't install default projection bound for return-positionimpl Trait in trait methods with no body Don't install default projection bound for return-position impl Trait in trait methods with no body Jul 16, 2023
@spastorino
Copy link
Member

Makes a lot of sense, r=me after rebasing

@compiler-errors
Copy link
Member Author

This is actually blocked on #113704, which I will clean up and write a better explanation for probably on Monday.

@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms rust-cloud-vms bot force-pushed the rpitit-projects-to-missing-opaque branch from 0773dc0 to 0f0ab89 Compare July 30, 2023 21:51
@compiler-errors
Copy link
Member Author

@bors r=spastorino

@bors
Copy link
Contributor

bors commented Jul 30, 2023

📌 Commit 0f0ab89 has been approved by spastorino

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 Jul 30, 2023
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Jul 31, 2023
…-missing-opaque, r=spastorino

Don't install default projection bound for return-position `impl Trait` in trait methods with no body

This ensures that we never try to project to an opaque type in a trait method that has no body to infer its hidden type, which means we never later call `type_of` on that opaque. This is because opaque types try to reveal their hidden type when proving auto traits.

I thought about this a lot, and I think this is a fix that's less likely to introduce other strange downstream ICEs than rust-lang#113461.

r? `@spastorino`
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 31, 2023
…kingjubilee

Rollup of 4 pull requests

Successful merges:

 - rust-lang#95965 (Stabilize const-weak-new)
 - rust-lang#109075 (Use `LazyLock` to lazily resolve backtraces)
 - rust-lang#113741 (Don't install default projection bound for return-position `impl Trait` in trait methods with no body)
 - rust-lang#114268 (Fix empty_write since rust version attribute)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 126d809 into rust-lang:master Jul 31, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 31, 2023
@compiler-errors compiler-errors deleted the rpitit-projects-to-missing-opaque branch August 11, 2023 20:18
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.

ICE: tried to get type of this RPITIT with no definition
5 participants