Rollup merge of #78231 - LeSeulArtichaut:closure-target_feature, r=nikomatsakis
Make closures inherit the parent function's target features r? @ghost Closes #73631
This commit is contained in:
commit
00c4dcdbb4
2 changed files with 27 additions and 1 deletions
|
|
@ -0,0 +1,18 @@
|
|||
// Tests #73631: closures inherit `#[target_feature]` annotations
|
||||
|
||||
// check-pass
|
||||
// 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue