[codegen] unnecessary panicking branch in foo().await
(vs equivalent FutureImpl.await
)
#71093
Labels
A-async-await
Area: Async & Await
A-codegen
Area: Code generation
A-coroutines
Area: Coroutines
A-LLVM
Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
C-optimization
Category: An issue highlighting optimization opportunities or PRs implementing such
I-heavy
Issue: Problems and improvements with respect to binary size of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I compiled this
no_std
code with (LTO /-Oz
/-C panic=abort
) optimizations (full repro instructions at the bottom):I got machine code that includes a panicking branch:
I expected to see no panicking branches in the output. If I comment out
foo().await
and uncommentFoo.await
(which should be semantically equivalent) then I get the expected output:Interestingly,
bar().await
contains no panicking branch (because it's divergent?), butbaz().await
does (because it inherits it fromfoo().await
?).Meta
rustc --version --verbose
:Steps to reproduce
$ $EDITOR src/main.rs && cat src/main.rs
The text was updated successfully, but these errors were encountered: