Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f05087f
bump channel
BoxyUwU Mar 31, 2025
2d814ae
replace version placeholder
BoxyUwU Mar 31, 2025
45165c8
Auto merge of #139185 - BoxyUwU:beta, r=BoxyUwU
bors Apr 1, 2025
8e37a0b
bump stage0
BoxyUwU Apr 4, 2025
e6ed56a
Auto merge of #139360 - BoxyUwU:bump_beta_bootstrap, r=kobzol
bors Apr 5, 2025
35dae58
[beta-1.87] Update cargo
weihanglo Apr 7, 2025
a22ecb5
Auto merge of #139463 - weihanglo:update-beta-cargo, r=weihanglo
bors Apr 7, 2025
2f68518
Revert "Remove `prev_index_to_index` field from `CurrentDepGraph`"
Zoxc Apr 10, 2025
a594829
Auto merge of #139625 - Zoxc:revert-pr138824, r=oli-obk
bors Apr 12, 2025
d8fad75
[beta] Delay `hash_extract_if` stabilization from 1.87 to 1.88
dtolnay Apr 13, 2025
84ed87a
Fix 2024 edition doctest panic output
GuillaumeGomez Apr 3, 2025
3d4b571
Add regression test for #137970
GuillaumeGomez Apr 3, 2025
10e682e
Use `eprint!` instead of `eprintln!`
GuillaumeGomez Apr 3, 2025
d1cd5ee
make `Arguments::as_statically_known_str` doc(hidden)
mejrs Apr 4, 2025
4782bbc
Revert "Deduplicate template parameter creation"
petrochenkov Apr 15, 2025
e71ad4a
sync::mpsc: add miri reproducer of double free
petrosagg Apr 10, 2025
f31cf5c
sync::mpsc: prevent double free on `Drop`
petrosagg Apr 8, 2025
386abeb
Auto merge of #139988 - cuviper:beta-next, r=cuviper
bors Apr 19, 2025
67737df
Do not mix normalized and unnormalized caller bounds when constructin…
compiler-errors Mar 25, 2025
39721fa
Ignore zero-sized types in wasm future-compat warning
alexcrichton Apr 7, 2025
eaa7d3a
Don't warn about `v128` in wasm ABI transition
alexcrichton Apr 14, 2025
2aec882
Revert overzealous parse recovery for single colons
fmease Apr 24, 2025
7ef0050
Bless ui/associated-consts/issue-93835
cuviper Apr 24, 2025
74f40c4
Auto merge of #140269 - cuviper:beta-next, r=cuviper
bors Apr 26, 2025
9d6fe3d
Auto merge of #139765 - dtolnay:hashextractif, r=ChrisDenton
bors Apr 28, 2025
3864645
Don't delay a bug on malformed meta items involving interpolated tokens
fmease May 2, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Don't warn about v128 in wasm ABI transition
This has other warnings if necessary and doesn't need extra warnings from this FCW. cc #138762 (cherry picked from commit 19e44d4)
  • Loading branch information
alexcrichton authored and cuviper committed Apr 24, 2025
commit eaa7d3ace8d1e76fec9abb17e09dd7dd3ee5e1a7
6 changes: 6 additions & 0 deletions compiler/rustc_monomorphize/src/mono_checks/abi_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ fn wasm_abi_safe<'tcx>(tcx: TyCtxt<'tcx>, arg: &ArgAbi<'tcx, Ty<'tcx>>) -> bool
return true;
}

// Both the old and the new ABIs treat vector types like `v128` the same
// way.
if uses_vector_registers(&arg.mode, &arg.layout.backend_repr) {
return true;
}

// This matches `unwrap_trivial_aggregate` in the wasm ABI logic.
if arg.layout.is_aggregate() {
let cx = LayoutCx::new(tcx, TypingEnv::fully_monomorphized());
Expand Down
12 changes: 11 additions & 1 deletion tests/ui/lint/wasm_c_abi_transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@ add-core-stubs
//@ build-fail

#![feature(no_core)]
#![feature(no_core, repr_simd)]
#![no_core]
#![crate_type = "lib"]
#![deny(wasm_c_abi)]
Expand Down Expand Up @@ -45,3 +45,13 @@ pub fn call_other_fun(x: MyType) {
pub struct MyZstType;
#[allow(improper_ctypes_definitions)]
pub extern "C" fn zst_safe(_x: (), _y: MyZstType) {}

// The old and new wasm ABI treats simd types like `v128` the same way, so no
// wasm_c_abi warning should be emitted.
#[repr(simd)]
#[allow(non_camel_case_types)]
pub struct v128([i32; 4]);
#[target_feature(enable = "simd128")]
pub extern "C" fn my_safe_simd(x: v128) -> v128 { x }
//~^ WARN `extern` fn uses type `v128`, which is not FFI-safe
//~| WARN `extern` fn uses type `v128`, which is not FFI-safe
31 changes: 30 additions & 1 deletion tests/ui/lint/wasm_c_abi_transition.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
warning: `extern` fn uses type `v128`, which is not FFI-safe
--> $DIR/wasm_c_abi_transition.rs:55:35
|
LL | pub extern "C" fn my_safe_simd(x: v128) -> v128 { x }
| ^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> $DIR/wasm_c_abi_transition.rs:53:1
|
LL | pub struct v128([i32; 4]);
| ^^^^^^^^^^^^^^^
= note: `#[warn(improper_ctypes_definitions)]` on by default

warning: `extern` fn uses type `v128`, which is not FFI-safe
--> $DIR/wasm_c_abi_transition.rs:55:44
|
LL | pub extern "C" fn my_safe_simd(x: v128) -> v128 { x }
| ^^^^ not FFI-safe
|
= help: consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
= note: this struct has unspecified layout
note: the type is defined here
--> $DIR/wasm_c_abi_transition.rs:53:1
|
LL | pub struct v128([i32; 4]);
| ^^^^^^^^^^^^^^^

error: this function definition involves an argument of type `MyType` which is affected by the wasm ABI transition
--> $DIR/wasm_c_abi_transition.rs:18:1
|
Expand Down Expand Up @@ -33,7 +62,7 @@ LL | unsafe { other_fun(x) }
= note: for more information, see issue #138762 <https://github.com/rust-lang/rust/issues/138762>
= help: the "C" ABI Rust uses on wasm32-unknown-unknown will change to align with the standard "C" ABI for this target

error: aborting due to 3 previous errors
error: aborting due to 3 previous errors; 2 warnings emitted

Future incompatibility report: Future breakage diagnostic:
error: this function definition involves an argument of type `MyType` which is affected by the wasm ABI transition
Expand Down