summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs')
-rw-r--r--src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs b/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs
new file mode 100644
index 000000000..a59d7c2d7
--- /dev/null
+++ b/src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs
@@ -0,0 +1,20 @@
+// Tests #73631: closures inherit `#[target_feature]` annotations
+
+// check-pass
+// revisions: mir thir
+// [thir]compile-flags: -Z thir-unsafeck
+// only-x86_64
+
+#![feature(target_feature_11)]
+
+#[target_feature(enable="avx")]
+fn also_use_avx() {
+ println!("Hello from AVX")
+}
+
+#[target_feature(enable="avx")]
+fn use_avx() -> Box<dyn Fn()> {
+ Box::new(|| also_use_avx())
+}
+
+fn main() {}