Skip to content

Conversation

@daxpedda
Copy link
Contributor

@daxpedda daxpedda commented Dec 17, 2025

This PR adds a new target feature for Wasm targets: GC.
I went ahead and made this insta-stable because it has already passed phase 5 in addition to being implemented and stabilized by all major JS engines.

This doesn't enable the target feature by default!

For context: while this proposal adds a lot of new features to Wasm, they are not accessible through Rust apart from unstable inline ASM. This is largely useful to signal tools to make use of the feature, e.g. wasm-bindgen, where this can be used to make some pretty optimizations.

Companion PR: rust-lang/reference#2114.

r? @alexcrichton

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 17, 2025
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
test [ui] tests/ui/zero-sized/zero-sized-btreemap-insert.rs ... ok

failures:

---- [ui] tests/ui/abi/compatibility.rs#wasip1 stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/abi/compatibility.wasip1/compatibility.wasip1.stderr`
normalized stderr:
'+gc' is not a recognized feature for this target (ignoring feature)
'+gc' is not a recognized feature for this target (ignoring feature)



The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args abi/compatibility.rs`

error in revision `wasip1`: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/abi/compatibility.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--cfg" "wasip1" "--check-cfg" "cfg(test,FALSE,host,i686,x86_64,x86_64_win,arm,thumb,aarch64,s390x,mips,mips64,sparc,sparc64,powerpc,powerpc64,aix,riscv,loongarch32,loongarch64,wasm,wasip1,bpf,m68k,csky,nvptx64)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/abi/compatibility.wasip1" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Cpanic=abort" "-Cforce-unwind-tables=yes" "--target" "wasm32-wasip1" "--extern" "minicore=/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/abi/compatibility.wasip1/libminicore.rlib"
stdout: none
--- stderr -------------------------------
'+gc' is not a recognized feature for this target (ignoring feature)
'+gc' is not a recognized feature for this target (ignoring feature)
------------------------------------------

---- [ui] tests/ui/abi/compatibility.rs#wasip1 stdout end ----
---- [ui] tests/ui/abi/compatibility.rs#wasm stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/abi/compatibility.wasm/compatibility.wasm.stderr`
normalized stderr:
'+gc' is not a recognized feature for this target (ignoring feature)
'+gc' is not a recognized feature for this target (ignoring feature)



The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args abi/compatibility.rs`

error in revision `wasm`: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/abi/compatibility.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--cfg" "wasm" "--check-cfg" "cfg(test,FALSE,host,i686,x86_64,x86_64_win,arm,thumb,aarch64,s390x,mips,mips64,sparc,sparc64,powerpc,powerpc64,aix,riscv,loongarch32,loongarch64,wasm,wasip1,bpf,m68k,csky,nvptx64)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/abi/compatibility.wasm" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Cpanic=abort" "-Cforce-unwind-tables=yes" "--target" "wasm32-unknown-unknown" "--extern" "minicore=/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/abi/compatibility.wasm/libminicore.rlib"
stdout: none
--- stderr -------------------------------
'+gc' is not a recognized feature for this target (ignoring feature)
'+gc' is not a recognized feature for this target (ignoring feature)
------------------------------------------
---
To only update this specific test, also pass `--test-args check-cfg/target_feature.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/check-cfg/target_feature.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/check-cfg/target_feature" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--check-cfg=cfg()" "-Zcheck-cfg-all-expected"
stdout: none
--- stderr -------------------------------
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
##[warning]  --> /checkout/tests/ui/check-cfg/target_feature.rs:16:10
   |
LL |     cfg!(target_feature = "_UNEXPECTED_VALUE");
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: expected values for `target_feature` are: `10e60`, `2e3`, `32s`, `3e3r1`, `3e3r2`, `3e3r3`, `3e7`, `7e10`, `a`, `aclass`, `adx`, `aes`, `altivec`, `alu32`, `amx-avx512`, `amx-bf16`, `amx-complex`, `amx-fp16`, `amx-fp8`, `amx-int8`, `amx-movrs`, `amx-tf32`, `amx-tile`, `apxf`, `atomics`, `avx`, `avx10.1`, `avx10.2`, `avx2`, `avx512bf16`, `avx512bitalg`, `avx512bw`, `avx512cd`, `avx512dq`, `avx512f`, `avx512fp16`, `avx512ifma`, `avx512vbmi`, `avx512vbmi2`, `avx512vl`, `avx512vnni`, `avx512vp2intersect`, `avx512vpopcntdq`, `avxifma`, `avxneconvert`, `avxvnni`, `avxvnniint16`, `avxvnniint8`, `b`, `backchain`, `bf16`, `bmi1`, `bmi2`, `bti`, `bulk-memory`, `c`, `cache`, `cmpxchg16b`, `concurrent-functions`, `crc`, `crt-static`, `cssc`, `d`, `d32`, `deflate-conversion`, `dit`, `div32`, `doloop`, `dotprod`, `dpb`, `dpb2`, `dsp`, `dsp1e2`, `dspe60`, `e`, `e1`, `e2`, `ecv`, `edsp`, `elrw`, `enhanced-sort`, `ermsb`, `exception-handling`, `extended-const`, `f`, `f16c`, `f32mm`, `f64mm`, `faminmax`, `fcma`, `fdivdu`, `fhm`, `flagm`, `flagm2`, `float1e2`, `float1e3`, `float3e4`, `float7e60`, `floate1`, `fma`, `fp-armv8`, `fp16`, `fp64`, `fp8`, `fp8dot2`, `fp8dot4`, `fp8fma`, `fpregs`, `fpuv2_df`, `fpuv2_sf`, `fpuv3_df`, `fpuv3_hf`, `fpuv3_hi`, `fpuv3_sf`, `frecipe`, `frintts`, `fxsr`, `gc`, `gfni`, `guarded-storage`, `hard-float`, `hard-float-abi`, `hard-tp`, `hbc`, `high-registers`, `high-word`, `hvx`, `hvx-length128b`, `hwdiv`, `i8mm`, `isa-68000`, `isa-68010`, `isa-68020`, `isa-68030`, `isa-68040`, `isa-68060`, `isa-68881`, `isa-68882`, `jsconv`, `kl`, `lahfsahf`, `lam-bh`, `lamcas`, `lasx`, `lbt`, `ld-seq-sa`, `leoncasa`, `lor`, `lse`, `lse128`, `lse2`, `lsx`, `lut`, `lvz`, `lzcnt`, `m`, `mclass`, `message-security-assist-extension12`, `message-security-assist-extension3`, `message-security-assist-extension4`, `message-security-assist-extension5`, `message-security-assist-extension8`, `message-security-assist-extension9`, `miscellaneous-extensions-2`, `miscellaneous-extensions-3`, `miscellaneous-extensions-4`, `mops`, `movbe`, `movrs`, `mp`, `mp1e2`, `msa`, `msync`, `mte`, `multivalue`, `mutable-globals`, `neon`, `nnp-assist`, `nontrapping-fptoint`, `nvic`, `outline-atomics`, `paca`, `pacg`, `pan`, `partword-atomics`, `pauth-lr`, `pclmulqdq`, `pmuv3`, `popcnt`, `power10-vector`, `power8-altivec`, `power8-crypto`, `power8-vector`, `power9-altivec`, `power9-vector`, `prfchw`, `ptx32`, `ptx40`, `ptx41`, `ptx42`, `ptx43`, `ptx50`, `ptx60`, `ptx61`, `ptx62`, `ptx63`, `ptx64`, `ptx65`, `ptx70`, `ptx71`, `ptx72`, `ptx73`, `ptx74`, `ptx75`, `ptx76`, `ptx77`, `ptx78`, `ptx80`, `ptx81`, `ptx82`, `ptx83`, `ptx84`, `ptx85`, `ptx86`, `ptx87`, `quadword-atomics`, `rand`, `ras`, `rclass`, `rcpc`, `rcpc2`, `rcpc3`, `rdm`, `rdrand`, `rdseed`, `reference-types`, `relax`, `relaxed-simd`, `rtm`, `rva23u64`, `sb`, `scq`, `sha`, `sha2`, `sha3`, `sha512`, `sign-ext`, `simd128`, `sm3`, `sm4`, `sm_100`, `sm_100a`, `sm_101`, `sm_101a`, `sm_120`, `sm_120a`, `sm_20`, `sm_21`, `sm_30`, `sm_32`, `sm_35`, `sm_37`, `sm_50`, `sm_52`, `sm_53`, `sm_60`, `sm_61`, `sm_62`, `sm_70`, `sm_72`, `sm_75`, `sm_80`, `sm_86`, `sm_87`, `sm_89`, `sm_90`, `sm_90a`, `sme`, `sme-b16b16`, `sme-f16f16`, `sme-f64f64`, `sme-f8f16`, `sme-f8f32`, `sme-fa64`, `sme-i16i64`, `sme-lutv2`, `sme2`, `sme2p1`, `soft-float`, `spe`, `ssbs`, `sse`, `sse2`, `sse3`, `sse4.1`, `sse4.2`, `sse4a`, `ssse3`, `ssve-fp8dot2`, `ssve-fp8dot4`, `ssve-fp8fma`, `supm`, `sve`, `sve-b16b16`, `sve2`, `sve2-aes`, `sve2-bitperm`, `sve2-sha3`, `sve2-sm4`, `sve2p1`, `tail-call`, `tbm`, `thumb-mode`, `thumb2`, `tme`, `transactional-execution`, `trust`, `trustzone`, `ual`, `unaligned-scalar-mem`, `unaligned-vector-mem`, `v`, `v5te`, `v6`, `v6k`, `v6t2`, `v7`, `v8`, `v8.1a`, `v8.2a`, `v8.3a`, `v8.4a`, `v8.5a`, `v8.6a`, `v8.7a`, `v8.8a`, `v8.9a`, `v8plus`, `v9`, `v9.1a`, `v9.2a`, `v9.3a`, `v9.4a`, `v9.5a`, `v9a`, `vaes`, `vdsp2e60f`, `vdspv1`, `vdspv2`, `vector`, `vector-enhancements-1`, `vector-enhancements-2`, `vector-enhancements-3`, `vector-packed-decimal`, `vector-packed-decimal-enhancement`, `vector-packed-decimal-enhancement-2`, `vector-packed-decimal-enhancement-3`, `vfp2`, `vfp3`, `vfp4`, `vh`, `virt`, `virtualization`, `vpclmulqdq`, `vsx`, `wfxt`, `wide-arithmetic`, `widekl`, `x87`, `xop`, `xsave`, `xsavec`, `xsaveopt`, `xsaves`, `za128rs`, `za64rs`, `zaamo`, `zabha`, `zacas`, `zalrsc`, `zama16b`, `zawrs`, `zba`, `zbb`, `zbc`, `zbkb`, `zbkc`, `zbkx`, `zbs`, `zca`, `zcb`, `zcmop`, `zdinx`, `zfa`, `zfbfmin`, `zfh`, `zfhmin`, `zfinx`, `zhinx`, `zhinxmin`, `zic64b`, `zicbom`, `zicbop`, `zicboz`, `ziccamoa`, `ziccif`, `zicclsm`, `ziccrse`, `zicntr`, `zicond`, `zicsr`, `zifencei`, `zihintntl`, `zihintpause`, `zihpm`, `zimop`, `zk`, `zkn`, `zknd`, `zkne`, `zknh`, `zkr`, `zks`, `zksed`, `zksh`, `zkt`, `ztso`, `zvbb`, `zvbc`, `zve32f`, `zve32x`, `zve64d`, `zve64f`, `zve64x`, `zvfbfmin`, `zvfbfwma`, `zvfh`, `zvfhmin`, `zvkb`, `zvkg`, `zvkn`, `zvknc`, `zvkned`, `zvkng`, `zvknha`, `zvknhb`, `zvks`, `zvksc`, `zvksed`, `zvksg`, `zvksh`, `zvkt`, `zvl1024b`, `zvl128b`, `zvl16384b`, `zvl2048b`, `zvl256b`, `zvl32768b`, `zvl32b`, `zvl4096b`, `zvl512b`, `zvl64b`, `zvl65536b`, and `zvl8192b`
   = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
   = note: `#[warn(unexpected_cfgs)]` on by default

warning: 1 warning emitted
------------------------------------------
---
To only update this specific test, also pass `--test-args codegen/target-cpus.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/codegen/target-cpus.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/codegen/target-cpus" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--print=target-cpus" "--target=wasm32-unknown-unknown"
--- stdout -------------------------------
Available CPUs for this target:
    bleeding-edge
    generic       - This is the default target CPU for the current build target (currently wasm32-unknown-unknown).
    lime1
    mvp
------------------------------------------
--- stderr -------------------------------
'+gc' is not a recognized feature for this target (ignoring feature)
'+gc' is not a recognized feature for this target (ignoring feature)
------------------------------------------

---- [ui] tests/ui/codegen/target-cpus.rs stdout end ----
---- [ui] tests/ui/print-request/supported-crate-types.rs#wasm stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/print-request/supported-crate-types.wasm/supported-crate-types.wasm.stderr`
normalized stderr:
'+gc' is not a recognized feature for this target (ignoring feature)
'+gc' is not a recognized feature for this target (ignoring feature)



The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args print-request/supported-crate-types.rs`

error in revision `wasm`: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/print-request/supported-crate-types.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--cfg" "wasm" "--check-cfg" "cfg(test,FALSE,wasm,musl,linux)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/print-request/supported-crate-types.wasm" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--target=wasm32-unknown-unknown" "--print=supported-crate-types" "-Zunstable-options"
--- stdout -------------------------------
bin
cdylib
lib
rlib

@daxpedda
Copy link
Contributor Author

Ah, 'tis unfortunate, will have to wait until the next LLVM version.

@daxpedda daxpedda marked this pull request as draft December 17, 2025 20:41
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants