forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#129764 - veluca93:struct_tf, r=<try>
struct_target_features: reduce serialized rmeta Reduce the amount of serialized information in rmeta. This should fix the binary size regression in rust-lang#127537 and *may* also fix the speed regression. r? compiler-errors Tracking issue: rust-lang#129107
- Loading branch information
Showing
6 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/ui/target-feature/auxiliary/struct-target-features-crate-dep.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#![feature(struct_target_features)] | ||
|
||
#[target_feature(enable = "avx")] | ||
pub struct Avx {} | ||
|
||
pub struct NoFeatures {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//@ only-x86_64 | ||
//@ aux-build: struct-target-features-crate-dep.rs | ||
//@ check-pass | ||
#![feature(target_feature_11)] | ||
|
||
extern crate struct_target_features_crate_dep; | ||
|
||
#[target_feature(enable = "avx")] | ||
fn avx() {} | ||
|
||
fn f(_: struct_target_features_crate_dep::Avx) { | ||
avx(); | ||
} | ||
|
||
fn g(_: struct_target_features_crate_dep::NoFeatures) {} | ||
|
||
fn main() { | ||
if is_x86_feature_detected!("avx") { | ||
let avx = unsafe { struct_target_features_crate_dep::Avx {} }; | ||
f(avx); | ||
} | ||
g(struct_target_features_crate_dep::NoFeatures {}); | ||
} |