-
Notifications
You must be signed in to change notification settings - Fork 13k
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 ICE when return impl ?Sized
#97413
Conversation
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. |
impl ?Sized
impl ?Sized
impl ?Sized
impl ?Sized
Could you add a regression test like #97328? |
@JohnTitor updated |
This comment has been minimized.
This comment has been minimized.
Thanks! I'm going to defer to @compiler-errors for the rest of the reviews. |
Hi @LYF1999, I don't know if this is the right fix. Can you give me some time to do investigation? Thanks. |
@compiler-errors Sure, take your time. |
@compiler-errors Thanks! |
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.
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.
better tip for return
impl ?Sized
Fixes #97226