-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[target_feature(enable = "simd128")]
does not work properly on 1.73, but work fine on 1.72.1
#116516
Comments
And then this was fixed by (or at least it started compiling since) #115580 |
Hm, why does it think that the Cc @eduardosm |
Ah, that's what changed in #115580 -- that attribute got removed from a bunch of functions. This was changed in rust-lang/stdarch#1448. Cc @Amanieu |
That was changed in stdarch specifically in response to #113720, to avoid breaking users who were using the |
In principle we could probably silence this check on wasm, since we document wasm to be a target where calling functions with unsupported target features is safe. |
What happens in wasm when you call a function that requires an unavailable target feature? |
I am told that the wasm runtime will refuse to even load a module that contains invalid operations, so there are two options:
|
We have a special exception for wasm that allows target_feature functions to not be marked unsafe: rust/compiler/rustc_codegen_ssa/src/codegen_attrs.rs Lines 279 to 309 in 8fa7bdf
We should probably have the same exception in the target-feature check in the interpreter. @eduardosm do you have the time for a follow-up PR implementing that? |
@apiraino I re-checked on latest nightly and seems to work fine: $ rustup default nightly
info: using existing install for 'nightly-x86_64-pc-windows-msvc'
info: default toolchain set to 'nightly-x86_64-pc-windows-msvc'
nightly-x86_64-pc-windows-msvc unchanged - rustc 1.75.0-nightly (bf9a1c8a1 2023-10-08)
$ rustup target add wasm32-unknown-unknown
info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
$ cargo build --target=wasm32-unknown-unknown
Compiling fail v0.1.0 (C:\Users\123\Desktop\regression_test)
Finished dev [unoptimized + debuginfo] target(s) in 0.18s |
I will do that |
WG-prioritization assigning priority (Zulip discussion). Issue is fixed on nightly+beta, leaving open to follow PR #116576 fixing this comment @rustbot label -I-prioritize +P-medium |
Rollup merge of rust-lang#116576 - eduardosm:const-eval-wasm-target-features, r=RalfJung const-eval: allow calling functions with targat features disabled at compile time in WASM This is not unsafe on WASM, see rust-lang#84988 r? `@RalfJung` Fixes rust-lang#116516
In which version this fix will be included? |
Should land in stable 1.74 (around mid November), iiuc. See release cycle or an easier to read calendar |
…r=RalfJung 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 r? `@RalfJung` Fixes rust-lang/rust#116516
Code
I tried this code on 1.73:
Compiled it with
cargo build --target=wasm32-unknown-unknown
, I expected it to compile fine as on previous 1.72.1, but it gave me these errors:Version it worked on
It most recently worked on: 1.72.1
Output:
Version with regression
rustc --version --verbose
:Other
I read release notes for 1.73 and couldn't find anything that could be related to this, also tried to search for an existing issue about this - no luck. This issue also broke compilation of fast_image_resize crate and transitively, Fyrox game engine.
The text was updated successfully, but these errors were encountered: