-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Async drop poll shim for error dropee generates noop body #140967
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
base: master
Are you sure you want to change the base?
Async drop poll shim for error dropee generates noop body #140967
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? oli-obk |
@@ -121,9 +121,10 @@ pub(super) fn build_async_drop_shim<'tcx>( | |||
parent_args.as_coroutine().resume_ty(), | |||
))); | |||
body.phase = MirPhase::Runtime(RuntimePhase::Initial); | |||
if !needs_async_drop { | |||
if !needs_async_drop || matches!(drop_ty.kind(), ty::Error(_)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use is_tainted_by_errors on drop_ty
, as it may contain drop things within. E.g. I think this may still ICE on Struct<str>
being used for a Struct<impl Sized>
return type
Fixes #140930.
When dropee type for async drop poll shim is
ty::Error(_)
, the generated poll function will be noop body. To avoid ICE inelaborate_drop
.