2020-10-22 06:55:19 -05:00
|
|
|
// Tests #73631: closures inherit `#[target_feature]` annotations
|
|
|
|
|
|
|
|
// check-pass
|
2021-05-14 16:52:34 -05:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
2020-10-22 06:55:19 -05:00
|
|
|
// only-x86_64
|
|
|
|
|
|
|
|
#[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 07:37:42 -05:00
|
|
|
fn main() {}
|