-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 fn_sig_for_fn_abi and the coroutine transform for generators #118219
Conversation
r? @davidtwco (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
Fixes #116447 (comment) |
This comment has been minimized.
This comment has been minimized.
There were three issues previously: * The self argument was pinned, despite Iterator::next taking an unpinned mutable reference. * A resume argument was passed, despite Iterator::next not having one. * The return value was CoroutineState<Item, ()> rather than Option<Item> While these things just so happened to work with the LLVM backend, cg_clif does much stricter checks when trying to assign a value to a place. In addition it can't handle the mismatch between the amount of arguments specified by the FnAbi and the FnSig.
f4e4aa7
to
b7bc8d5
Compare
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.
r=me with or without doing more exhaustive matching on coroutine kind
Thanks @bjorn3 for catching this. I really appreciate that clif is a lot less forgiving with ABI -- you've already caught a few of these mismatched in the past. |
Added exhaustive matching and fixed the assertion on the resume type. |
This comment has been minimized.
This comment has been minimized.
ceb5f13
to
f711dd8
Compare
This comment has been minimized.
This comment has been minimized.
f711dd8
to
b3f9fcb
Compare
This comment has been minimized.
This comment has been minimized.
b3f9fcb
to
543e559
Compare
@bors r=compiler-errors |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1fd418f): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 675.904s -> 675.686s (-0.03%) |
Here you did mention that despite the LLVM backend accepting it, it was triggering UB. Does this PR fixes this for LLVM as well? |
Yes |
There were three issues previously:
While these things just so happened to work with the LLVM backend, cg_clif does much stricter checks when trying to assign a value to a place. In addition it can't handle the mismatch between the amount of arguments specified by the FnAbi and the FnSig.