about summary refs log tree commit diff
path: root/tests/ui/abi/compatibility.rs
AgeCommit message (Collapse)AuthorLines
2025-05-01Remove redundant min-llvm-version annotations for LoongArch testsWANG Rui-1/+0
2025-03-25add FCW to warn about wasm ABI transitionRalf Jung-1/+0
2025-03-14rustc_target: Add target features for LoongArch v1.1WANG Rui-0/+1
2024-10-31tests: use minicore in `tests/ui/abi/compatibility.rs` as an example许杰友 Jieyou Xu (Joe)-55/+14
2024-10-24Rollup merge of #130225 - adetaylor:rename-old-receiver, r=wesleywiserStuart Cook-4/+4
Rename Receiver -> LegacyReceiver As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait. This PR renames the old trait to get it out the way. Naming is hard. Options considered included: * HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded) * LegacyReceiver * TargetLessReceiver * OldReceiver These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether. Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages. It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? `@wesleywiser`
2024-10-22Rename Receiver -> LegacyReceiverAdrian Taylor-4/+4
As part of the "arbitrary self types v2" project, we are going to replace the current `Receiver` trait with a new mechanism based on a new, different `Receiver` trait. This PR renames the old trait to get it out the way. Naming is hard. Options considered included: * HardCodedReceiver (because it should only be used for things in the standard library, and hence is sort-of hard coded) * LegacyReceiver * TargetLessReceiver * OldReceiver These are all bad names, but fortunately this will be temporary. Assuming the new mechanism proceeds to stabilization as intended, the legacy trait will be removed altogether. Although we expect this trait to be used only in the standard library, we suspect it may be in use elsehwere, so we're landing this change separately to identify any surprising breakages. It's known that this trait is used within the Rust for Linux project; a patch is in progress to remove their dependency. This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519 https://github.com/rust-lang/rust/issues/44874 r? @wesleywiser
2024-10-21abi/compatibility: also test Option-like typesRalf Jung-1/+17
2024-10-11rename RcBox in other places tooJonathan Dönszelmann-3/+3
2024-09-18Update the minimum external LLVM to 18Josh Stone-1/+0
2024-09-10abi/compatibility test: remove tests inside repr(C) wrappersRalf Jung-41/+11
2024-08-27ABI compat check: detect unadjusted ABI mismatchesRalf Jung-3/+4
2024-07-04Rollup merge of #123043 - GoldsteinE:fix/repr-c-dead-branches, r=oli-obkMatthias Krüger-0/+5
Disable dead variant removal for `#[repr(C)]` enums. This prevents removing dead branches from a `#[repr(C)]` enum (they now get discriminants allocated as if they were inhabited). Implementation notes: ABI of something like ```rust #[repr(C)] enum Foo { Foo(!), } ``` is still `Uninhabited`, but its layout is now computed as if all the branches were inhabited. This seemed to me like a proper way to do it, especially given that ABI sanity check explicitly asserts that type-level uninhabitedness implies ABI uninhabitedness. This probably needs some sort of FCP (given that it changes `#[repr(C)]` layout, which is a stable guarantee), but I’m not sure how to call for one or which team is the most relevant. See https://github.com/rust-lang/unsafe-code-guidelines/issues/500.
2024-06-28Clarify guarantees about ABI compatibilityMax “Goldstein” Siling-0/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-06-28Disable dead variant removal for `#[repr(C)]` enums.Goldstein-0/+4
See https://github.com/rust-lang/unsafe-code-guidelines/issues/500.
2024-05-31NVPTX: Avoid PassMode::Direct for C ABIKjetil Kjeka-7/+3
2024-05-29tests: reenable ABI compatibility test for cskyJubilee Young-8/+5
2024-05-29fn_arg_sanity_check: fix panic messageRalf Jung-0/+1
also update csky comment in abi/compatibility test
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-03-06loongarch: add frecipe and relax target featureWANG Rui-1/+1
2024-03-05only set noalias on Box with the global allocatorRalf Jung-0/+1
2024-03-02Add a new `wasm32-wasip1` target to rustcAlex Crichton-3/+3
This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-02-25Use generic `NonZero` in tests.Markus Reiter-4/+5
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-54/+54
2023-12-11Auto merge of #118032 - RalfJung:char-u32, r=Mark-Simulacrumbors-0/+7
guarantee that char and u32 are ABI-compatible In https://github.com/rust-lang/rust/pull/116894 we added a guarantee that `char` has the same alignment as `u32`, but there is still one axis where these types could differ: function call ABI. So let's nail that down as well: in a function signature, `char` and `u32` are completely equivalent. This is a new stable guarantee, so it will need t-lang approval.
2023-11-19Auto merge of #117500 - RalfJung:aggregate-abi, r=davidtwcobors-3/+27
Ensure sanity of all computed ABIs This moves the ABI sanity assertions from the codegen backend to the ABI computation logic. Sadly, due to past mistakes, we [have to](https://github.com/rust-lang/rust/pull/117351#issuecomment-1788495503) be able to compute a sane ABI for nonsensical function types like `extern "C" fn(str) -> str`. So to make the sanity check pass we first need to make all ABI adjustment deal with unsized types... and we have no shared infrastructure for those adjustments, so that's a bunch of copy-paste. At least we have assertions failing loudly when one accidentally sets a different mode for an unsized argument. To achieve this, this re-lands the parts of https://github.com/rust-lang/rust/pull/80594 that got reverted in https://github.com/rust-lang/rust/pull/81388. To avoid breaking wasm ABI again, that ABI now explicitly opts-in to the (wrong, broken) ABI that we currently keep for backwards compatibility. That's still better than having *every* ABI use the wrong broken default! Cc `@bjorn3` Fixes https://github.com/rust-lang/rust/issues/115845
2023-11-19disable csky test on CIRalf Jung-3/+5
2023-11-18guarantee that char and u32 are ABI-compatibleRalf Jung-0/+7
2023-11-07test and fix some more targetsRalf Jung-0/+9
2023-11-04document ABI compatibilityRalf Jung-4/+4
2023-11-03default Aggregate ABI to Indirect, and make sure it's never used for unsizedRalf Jung-0/+11
2023-11-03move ABI sanity check from LLVM codegen backend to ABI computation logicRalf Jung-3/+5
2023-10-24tests/ui/abi/compatibility: Set min-llvm-version to 17 for LoongArch64WANG Rui-0/+1
2023-09-22run abi/compatibility test against a whole bunch of targetsRalf Jung-10/+173
2023-09-20tests/ui/abi: Enable repr(transparent) union ABI tests on LoongArch64WANG Rui-2/+0
2023-09-19tests/ui/abi: Enable repr(transparent) union ABI tests on RISC-Vmsizanoen-2/+1
2023-09-12add some DispatchFromDyn ABI compatibility testsRalf Jung-0/+5
2023-09-12add enough cfg to make the test pass on problematic targetsRalf Jung-14/+39
2023-09-12also test ABI-compatibility for some unsized typesRalf Jung-2/+19
2023-09-12make sure the types in the ABI compat test actually type-checkRalf Jung-2/+5
2023-09-11Rollup merge of #115708 - RalfJung:homogeneous, r=davidtwcoMatthias Krüger-8/+2
fix homogeneous_aggregate not ignoring some ZST This is an ABI-breaking change, because it fixes bugs in our ABI code. I'm not sure what that means for this PR, we don't really have a process for such changes, do we? I can only hope nobody relied on the old buggy behavior. Fixes https://github.com/rust-lang/rust/issues/115664
2023-09-10fix homogeneous_aggregate not ignoring some 1-ZSTRalf Jung-8/+2
2023-09-09rustc_layout, rustc_abi: make sure the types are well-formedRalf Jung-4/+5
2023-09-08need to disable part of this test on armRalf Jung-1/+8
2023-09-08add a testcase for another MIPS64 bugRalf Jung-0/+1
2023-09-08merge transparent-abi test into general abi compatibility test, and test ↵Ralf Jung-2/+42
repr(transparent) unions
2023-09-08add tests for RFC 3391Ralf Jung-0/+25
2023-09-08accept some differences for rustc_abi(assert_eq), so that we can test more ↵Ralf Jung-0/+76
things to be compatible