about summary refs log tree commit diff
path: root/tests/ui/async-await/async-closures/fn-exception-target-features.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/async-closures/fn-exception-target-features.rs')
-rw-r--r--tests/ui/async-await/async-closures/fn-exception-target-features.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.rs b/tests/ui/async-await/async-closures/fn-exception-target-features.rs
new file mode 100644
index 00000000000..de62fc8bf7e
--- /dev/null
+++ b/tests/ui/async-await/async-closures/fn-exception-target-features.rs
@@ -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
+}