]> git.proxmox.com Git - rustc.git/blob - src/test/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / rfcs / rfc-2396-target_feature-11 / closures-inherit-target_feature.rs
1 // Tests #73631: closures inherit `#[target_feature]` annotations
2
3 // check-pass
4 // revisions: mir thir
5 // [thir]compile-flags: -Z thir-unsafeck
6 // only-x86_64
7
8 #![feature(target_feature_11)]
9
10 #[target_feature(enable="avx")]
11 fn also_use_avx() {
12 println!("Hello from AVX")
13 }
14
15 #[target_feature(enable="avx")]
16 fn use_avx() -> Box<dyn Fn()> {
17 Box::new(|| also_use_avx())
18 }
19
20 fn main() {}