-
Notifications
You must be signed in to change notification settings - Fork 332
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 #2986 - rust-lang:rustup-2023-07-18, r=RalfJung
Automatic sync from rustc
- Loading branch information
Showing
8 changed files
with
50 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ffb9b61294b96c389d343a4c55b15400249d74e6 | ||
ec362f0ae8a05618b75727cfdca853540cb2950e |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//@only-target-x86_64: uses x86 target features | ||
//@ignore-target-x86_64-apple-darwin: that target actually has ssse3 | ||
|
||
fn main() { | ||
assert!(!is_x86_feature_detected!("ssse3")); | ||
unsafe { | ||
ssse3_fn(); //~ ERROR: calling a function that requires unavailable target features: ssse3 | ||
} | ||
} | ||
|
||
#[target_feature(enable = "ssse3")] | ||
unsafe fn ssse3_fn() {} |
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,15 @@ | ||
error: Undefined Behavior: calling a function that requires unavailable target features: ssse3 | ||
--> $DIR/target_feature.rs:LL:CC | ||
| | ||
LL | ssse3_fn(); | ||
| ^^^^^^^^^^ calling a function that requires unavailable target features: ssse3 | ||
| | ||
= help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior | ||
= help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information | ||
= note: BACKTRACE: | ||
= note: inside `main` at $DIR/target_feature.rs:LL:CC | ||
|
||
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace | ||
|
||
error: aborting due to previous error | ||
|
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,12 @@ | ||
//@only-target-x86_64: uses x86 target features | ||
//@compile-flags: -C target-feature=+ssse3 | ||
|
||
fn main() { | ||
assert!(is_x86_feature_detected!("ssse3")); | ||
unsafe { | ||
ssse3_fn(); | ||
} | ||
} | ||
|
||
#[target_feature(enable = "ssse3")] | ||
unsafe fn ssse3_fn() {} |