Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
fe03f76
std: Add performance warnings to HashMap::get_disjoint_mut
xizheyin Apr 3, 2025
2678d04
mitigate MSVC unsoundness by not emitting alignment attributes on win…
RalfJung Apr 2, 2025
e702f96
check_align: we can still check low alignments on MSVC
RalfJung Apr 4, 2025
75f86e6
fix LooseTypes flag and PrintMod behaviour, add debug helper
ZuseZ4 Apr 12, 2025
31578dc
fix "could not find source function" error by preventing function mer…
ZuseZ4 Apr 12, 2025
5ea9125
update documentation
ZuseZ4 Apr 12, 2025
f79a992
add tests for merge_function handling
ZuseZ4 Apr 12, 2025
35a20de
Implement `SmirInterface`
makai410 Apr 18, 2025
16381b3
Use `currently` for futher improvement
xizheyin Apr 20, 2025
2ef4f78
rustc_target: Adjust RISC-V feature implication
a4lg Apr 22, 2025
90fe280
Move `sys::pal::os::Env` into `sys::env`
thaliaarchi Apr 22, 2025
6518bcb
Fix `unsafe_op_in_unsafe_fn` for Unix env
thaliaarchi Apr 22, 2025
1b00ebe
Update !DynSend and !DynSync platform impls
thaliaarchi Apr 22, 2025
4695212
Deduplicate unsupported env items
thaliaarchi Apr 22, 2025
01485c9
Unify owned `Env` types between platforms
thaliaarchi Apr 22, 2025
08baec4
add a test for byte string literal pattern mutability mismatches
dianne Apr 22, 2025
6184025
make `str` literal patterns usable in deref patterns
dianne Mar 25, 2025
3250344
make `[u8]` and `[u8;N]` literal patterns usable in deref patterns
dianne Apr 16, 2025
4c7e866
update unstable book to mention string/bytestring typing
dianne Apr 19, 2025
19e44d4
Don't warn about `v128` in wasm ABI transition
alexcrichton Apr 14, 2025
09e36ce
[compiletest] Parallelize test discovery
tmandry Apr 22, 2025
51088fd
Remove `synstructure::Structure::underscore_const` calls.
nnethercote Apr 23, 2025
e18e599
set subsections_via_symbols for ld64 helper sections
usamoi Apr 13, 2025
17664d1
Update doc of cygwin target
Berrysoft Apr 23, 2025
fdf2c47
[AIX] Handle AIX dynamic library extensions within c-link-to-rust-dyl…
amy-kwan Apr 23, 2025
0a76ef8
Rename `compute_x` methods
BoxyUwU Apr 23, 2025
c6e6ac9
Module docs
BoxyUwU Apr 23, 2025
5b390cd
Make `SmirInterface` pub(crate) and rename `Context` to `SmirContext`
makai410 Apr 23, 2025
0296f05
Make algebraic intrinsics into 'const fn' items; Make algebraic funct…
bjoernager Apr 22, 2025
a4b9a1b
Remove `git_repository` field from `GitConfig`
Kobzol Apr 23, 2025
91da45a
Remove `git_repository` from the `stage0` file
Kobzol Apr 23, 2025
e3296cd
compiletest: `//@ add-core-stubs` implies `-Cforce-unwind-tables=yes`
jieyouxu Apr 23, 2025
c79f156
tests: account for CFI directives in `tests/assembly/x86-return-float…
jieyouxu Apr 23, 2025
f2ab763
rustc-dev-guide: document that `//@ add-core-stubs` imply `-Cforce-un…
jieyouxu Apr 23, 2025
f0399b8
triagebot: label minicore changes w/ `A-test-infra-minicore`
jieyouxu Apr 23, 2025
18c3370
CI: use aws codebuild for job dist-arm-linux
marcoieni Apr 23, 2025
157caee
fix f*::MAX_EXP and MIN_EXP docs
RalfJung Apr 22, 2025
7493e1c
Make #![feature(let_chains)] bootstrap conditional in compiler/
est31 Apr 23, 2025
1162f42
Remove hack
compiler-errors Apr 23, 2025
2a5c349
Extend HIR to track the source and syntax of a lifetime
shepmaster Mar 28, 2025
308cfb8
Rollup merge of #139261 - RalfJung:msvc-align-mitigation, r=oli-obk
Zalathar Apr 24, 2025
83ecddd
Rollup merge of #139307 - xizheyin:issue-139296, r=joboet
Zalathar Apr 24, 2025
331e4b0
Rollup merge of #139700 - EnzymeAD:autodiff-flags, r=oli-obk
Zalathar Apr 24, 2025
66979b2
Rollup merge of #139752 - usamoi:macos-used, r=saethlin,madsmtm
Zalathar Apr 24, 2025
54c65e6
Rollup merge of #139809 - alexcrichton:wasm-simd-safe, r=RalfJung
Zalathar Apr 24, 2025
1ba0ffe
Rollup merge of #139852 - makai410:smir-refactor, r=celinval
Zalathar Apr 24, 2025
570302d
Rollup merge of #139945 - shepmaster:hir-lifetime-syntax-source, r=nn…
Zalathar Apr 24, 2025
7a32312
Rollup merge of #140028 - dianne:lit-deref-pats-p1, r=oli-obk
Zalathar Apr 24, 2025
01271ba
Rollup merge of #140139 - a4lg:riscv-feature-imply-adjust-1, r=Amanieu
Zalathar Apr 24, 2025
6c1d167
Rollup merge of #140143 - thaliaarchi:move-env-pal, r=joboet
Zalathar Apr 24, 2025
9c368a8
Rollup merge of #140148 - marcoieni:ci-aws-codebuild, r=Kobzol
Zalathar Apr 24, 2025
8e8293e
Rollup merge of #140150 - RalfJung:MAX_EXP, r=tgross35
Zalathar Apr 24, 2025
42bc414
Rollup merge of #140172 - bjoernager:const-float-algebraic, r=RalfJung
Zalathar Apr 24, 2025
8d4283f
Rollup merge of #140177 - tmandry:compiletest-par, r=jieyouxu
Zalathar Apr 24, 2025
0f1f49a
Rollup merge of #140181 - nnethercote:rm-underscore_const, r=compiler…
Zalathar Apr 24, 2025
bd71363
Rollup merge of #140184 - Berrysoft:cygwin-target-doc, r=Noratrieb
Zalathar Apr 24, 2025
ca9a2d1
Rollup merge of #140186 - BoxyUwU:compute_what, r=compiler-errors
Zalathar Apr 24, 2025
81d17e6
Rollup merge of #140187 - amy-kwan:amy-kwan/update_runmake_tests_AIX,…
Zalathar Apr 24, 2025
11c4cc9
Rollup merge of #140191 - Kobzol:remove-git-repository-from-git-confi…
Zalathar Apr 24, 2025
d531fae
Rollup merge of #140194 - jieyouxu:minicore-force-unwind-tables, r=bj…
Zalathar Apr 24, 2025
6d371c5
Rollup merge of #140195 - jieyouxu:minicore-triagebot, r=jieyouxu
Zalathar Apr 24, 2025
f108448
Rollup merge of #140202 - est31:let_chains_feature_compiler, r=lcnr
Zalathar Apr 24, 2025
a415a28
Rollup merge of #140214 - compiler-errors:remove-hack, r=lcnr
Zalathar Apr 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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