summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs
blob: a59d7c2d784c7b5830a5e1545d4460588c45ffe6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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() {}