Skip to content

Conversation

LYF1999
Copy link
Contributor

@LYF1999 LYF1999 commented May 26, 2022

better tip for return impl ?Sized

Fixes #97226

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 26, 2022
@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 26, 2022
@LYF1999 LYF1999 changed the title better tip for return impl ?Sized Fix ICE for return impl ?Sized May 26, 2022
@LYF1999 LYF1999 changed the title Fix ICE for return impl ?Sized Fix ICE when return impl ?Sized May 26, 2022
@JohnTitor
Copy link
Member

Could you add a regression test like #97328?

@LYF1999
Copy link
Contributor Author

LYF1999 commented May 26, 2022

@JohnTitor updated

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

r? @compiler-errors

@JohnTitor
Copy link
Member

Thanks! I'm going to defer to @compiler-errors for the rest of the reviews.

@compiler-errors
Copy link
Member

Hi @LYF1999, I don't know if this is the right fix. Can you give me some time to do investigation? Thanks.

@LYF1999
Copy link
Contributor Author

LYF1999 commented May 26, 2022

@compiler-errors Sure, take your time.

@compiler-errors
Copy link
Member

I think #97431 is the fix for the root cause, based on the bisection I did here. If that PR is not actually the right fix, then I will give this PR a deeper review!

@LYF1999
Copy link
Contributor Author

LYF1999 commented May 26, 2022

@compiler-errors Thanks!

@compiler-errors
Copy link
Member

I am closing this PR because #97431 fixes the underlying issue. Thanks @LYF1999 for the contribution and for raising this to awareness.

compiler-errors added a commit to compiler-errors/rust that referenced this pull request May 30, 2022
don't do `Sized` and other return type checks on RPIT's real type

Fixes an ICE where we're doing `Sized` check against the RPIT's real type, instead of against the opaque type. This differs from what we're doing in MIR typeck, which causes ICE rust-lang#97226.

This regressed in rust-lang#96516 -- this adjusts that fix to be a bit more conservative. That PR was backported and thus the ICE is also present in stable. Not sure if it's worth to beta and/or stable backport, probably not the latter but I could believe the former.

r? `@oli-obk`

cc: another attempt to fix this ICE rust-lang#97413. I believe this PR addresses the root cause.
ehuss pushed a commit to ehuss/rust that referenced this pull request Jun 24, 2022
don't do `Sized` and other return type checks on RPIT's real type

Fixes an ICE where we're doing `Sized` check against the RPIT's real type, instead of against the opaque type. This differs from what we're doing in MIR typeck, which causes ICE rust-lang#97226.

This regressed in rust-lang#96516 -- this adjusts that fix to be a bit more conservative. That PR was backported and thus the ICE is also present in stable. Not sure if it's worth to beta and/or stable backport, probably not the latter but I could believe the former.

r? `@oli-obk`

cc: another attempt to fix this ICE rust-lang#97413. I believe this PR addresses the root cause.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE using impl ?Sized in return position
7 participants