Closed
Description
Here's a MVCE:
#![allow(incomplete_features)]
#![feature(async_fn_in_trait)]
pub trait Foo {
// This should be a compile error, but isn't:
//
async fn woopsie_async(&self) -> String {
42
}
// This one is checked correctly:
//
// fn woopsie(&self) -> String {
// 42
// }
}
I expected to see this happen: compilation fails because I'm clearly returning an {integer}
instead of a String
Instead, this happened: bad codegen ("async fn resumed after completion")
Meta
rustc --version --verbose
:
rustc -vV
rustc 1.66.0-nightly (dcb376115 2022-10-20)
binary: rustc
commit-hash: dcb376115066d111dbf5f13d5ac2a2dbe8c12add
commit-date: 2022-10-20
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.2
amos@sonic ~/work/hring afit
❯ rustc --version --verbose
rustc 1.66.0-nightly (dcb376115 2022-10-20)
binary: rustc
commit-hash: dcb376115066d111dbf5f13d5ac2a2dbe8c12add
commit-date: 2022-10-20
host: x86_64-unknown-linux-gnu
release: 1.66.0-nightly
LLVM version: 15.0.2