-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
const-eval: allow calling functions with targat features disabled at …
…compile time in WASM This is not unsafe on WASM, see rust-lang/rust#84988
- Loading branch information
Showing
2 changed files
with
13 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@only-target-wasm32: tests WASM-specific behavior | ||
//@compile-flags: -C target-feature=-simd128 | ||
|
||
fn main() { | ||
// Calling functions with `#[target_feature]` is not unsound on WASM, see #84988 | ||
assert!(!cfg!(target_feature = "simd128")); | ||
simd128_fn(); | ||
} | ||
|
||
#[target_feature(enable = "simd128")] | ||
fn simd128_fn() {} |