2020-10-22 06:55:19 -05:00
|
|
|
// Tests #73631: closures inherit `#[target_feature]` annotations
|
|
|
|
|
|
|
|
// check-pass
|
|
|
|
// only-x86_64
|
|
|
|
|
2023-03-02 06:41:17 -06:00
|
|
|
#![feature(target_feature_11)]
|
|
|
|
|
2023-10-26 11:13:20 -05:00
|
|
|
#[target_feature(enable = "avx")]
|
2020-10-22 06:55:19 -05:00
|
|
|
fn also_use_avx() {
|
|
|
|
println!("Hello from AVX")
|
|
|
|
}
|
|
|
|
|
2023-10-26 11:13:20 -05:00
|
|
|
#[target_feature(enable = "avx")]
|
2020-10-22 06:55:19 -05:00
|
|
|
fn use_avx() -> Box<dyn Fn()> {
|
|
|
|
Box::new(|| also_use_avx())
|
|
|
|
}
|
|
|
|
|
2020-10-22 07:37:42 -05:00
|
|
|
fn main() {}
|