-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Desugar yield
in async gen
correctly, ensure gen
always returns unit
#119061
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
Conversation
r? @wesleywiser (rustbot has picked a reviewer for you, use r? to override) |
…umed by just inferring unit as ret type
10f43dd
to
0f10acf
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (59096cd): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 673.568s -> 672.298s (-0.19%) |
async gen
blocks desugaryield $expr
totask_context = yield async_gen_ready($expr)
. Previously we were not assigning thetask_context
correctly, meaning thatyield
expressions in async generators returned typeResumeTy
instead of()
, and that we were not storing thetask_context
(which is probably unsound if we were reading the old task-context which has an invalidated borrow or something...)(async?) gen
blocks and(async?) gen
fns return unit. Previously we were only checking this forgen fn
, meaning thatgen {}
andasync gen {}
andasync gen fn
were allowed to return values that weren't unit. This is why [ICE]: assertionleft == right
failed, left: std::future::ResumeTy, right: () #119058 was an ICE rather than an E0308.Fixes #119058.