Don't implement AsyncFn for FnDef/FnPtr that wouldnt implement Fn
This commit is contained in:
parent
9bad7ba324
commit
ec1c424293
6 changed files with 139 additions and 23 deletions
|
@ -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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue