1
Fork 0

Don't implement AsyncFn for FnDef/FnPtr that wouldnt implement Fn

This commit is contained in:
Michael Goulet 2024-08-07 12:36:41 -04:00
parent 9bad7ba324
commit ec1c424293
6 changed files with 139 additions and 23 deletions

View file

@ -0,0 +1,17 @@
//@ edition: 2021
//@ only-x86_64
#![feature(async_closure, target_feature_11)]
// `target_feature_11` just to test safe functions w/ target features.
use std::pin::Pin;
use std::future::Future;
#[target_feature(enable = "sse2")]
fn target_feature() -> Pin<Box<dyn Future<Output = ()> + 'static>> { todo!() }
fn test(f: impl async Fn()) {}
fn main() {
test(target_feature); //~ ERROR the trait bound
}