2020-10-22 13:55:19 +02:00
|
|
|
// Tests #73631: closures inherit `#[target_feature]` annotations
|
|
|
|
|
|
|
|
// check-pass
|
2021-05-14 23:52:34 +02:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
2020-10-22 13:55:19 +02:00
|
|
|
// only-x86_64
|
|
|
|
|
2023-03-02 13:41:17 +01:00
|
|
|
#![feature(target_feature_11)]
|
|
|
|
|
2020-10-22 13:55:19 +02:00
|
|
|
#[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())
|
|
|
|
}
|
|
|
|
|
2020-10-22 14:37:42 +02:00
|
|
|
fn main() {}
|