File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ //@only-target-x86_64: uses x86 target features
2
+
3
+ fn main ( ) {
4
+ assert ! ( !is_x86_feature_detected!( "ssse3" ) ) ;
5
+ unsafe {
6
+ ssse3_fn ( ) ; //~ ERROR: calling a function that requires unavailable target features: ssse3
7
+ }
8
+ }
9
+
10
+ #[ target_feature( enable = "ssse3" ) ]
11
+ unsafe fn ssse3_fn ( ) { }
Original file line number Diff line number Diff line change
1
+ error: Undefined Behavior: calling a function that requires unavailable target features: ssse3
2
+ --> $DIR/target_feature.rs:LL:CC
3
+ |
4
+ LL | ssse3_fn();
5
+ | ^^^^^^^^^^ calling a function that requires unavailable target features: ssse3
6
+ |
7
+ = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior
8
+ = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information
9
+ = note: BACKTRACE:
10
+ = note: inside `main` at $DIR/target_feature.rs:LL:CC
11
+
12
+ note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
13
+
14
+ error: aborting due to previous error
15
+
Original file line number Diff line number Diff line change
1
+ //@only-target-x86_64: uses x86 target features
2
+ //@compile-flags: -C target-feature=+ssse3
3
+
4
+ fn main ( ) {
5
+ assert ! ( is_x86_feature_detected!( "ssse3" ) ) ;
6
+ unsafe {
7
+ ssse3_fn ( ) ;
8
+ }
9
+ }
10
+
11
+ #[ target_feature( enable = "ssse3" ) ]
12
+ unsafe fn ssse3_fn ( ) { }
You can’t perform that action at this time.
0 commit comments