-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-async_fn_in_traitStatic async fn in traitsStatic async fn in traitsF-return_position_impl_trait_in_trait`#![feature(return_position_impl_trait_in_trait)]``#![feature(return_position_impl_trait_in_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
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
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-async_fn_in_traitStatic async fn in traitsStatic async fn in traitsF-return_position_impl_trait_in_trait`#![feature(return_position_impl_trait_in_trait)]``#![feature(return_position_impl_trait_in_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.