diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2025-03-05 21:46:46 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-05 21:46:46 +0800 |
| commit | fe4c0850fe1ddfd1054d2c92cb832bb59edde2ea (patch) | |
| tree | 7a4f9749a2a3cb7d327d693d5a0e9e7d0141dfda /tests | |
| parent | 9d1b2f7fda9845360c190b931a79acba495634e1 (diff) | |
| parent | 8a689878ced1b3c0834ea32265c7d1cd43750db4 (diff) | |
| download | rust-fe4c0850fe1ddfd1054d2c92cb832bb59edde2ea.tar.gz rust-fe4c0850fe1ddfd1054d2c92cb832bb59edde2ea.zip | |
Rollup merge of #138028 - workingjubilee:is-rustic-abi, r=compiler-errors
compiler: add `ExternAbi::is_rustic_abi` Various parts of the compiler were hand-rolling this extremely simple check that is nonetheless easy to get wrong as the compiler evolves over time. Discourage them from being so "original" again by replacing it with a single implementation on the type that represents these ABIs. This simplifies a surprising amount of code as a result. Also fixes #132981, an ICE that emerged due to other checks being made stricter.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/crashes/132981.rs | 11 | ||||
| -rw-r--r-- | tests/ui/abi/rust-cold-works-with-rustic-args.rs | 6 |
2 files changed, 6 insertions, 11 deletions
diff --git a/tests/crashes/132981.rs b/tests/crashes/132981.rs deleted file mode 100644 index 916c1559240..00000000000 --- a/tests/crashes/132981.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ known-bug: #132981 -//@compile-flags: -Clink-dead-code=true --crate-type lib -//@ only-x86_64 -//@ ignore-windows -// The set of targets this crashes on is really fiddly, because it is deep in our ABI logic. It -// crashes on x86_64-unknown-linux-gnu, and i686-pc-windows-msvc, but not on -// x86_64-pc-windows-msvc. If you are trying to fix this crash, don't pay too much attention to the -// directives. - -#![feature(rust_cold_cc)] -pub extern "rust-cold" fn foo(_: [usize; 3]) {} diff --git a/tests/ui/abi/rust-cold-works-with-rustic-args.rs b/tests/ui/abi/rust-cold-works-with-rustic-args.rs new file mode 100644 index 00000000000..57027364699 --- /dev/null +++ b/tests/ui/abi/rust-cold-works-with-rustic-args.rs @@ -0,0 +1,6 @@ +//@build-pass +//@compile-flags: -Clink-dead-code=true --crate-type lib +// We used to not handle all "rustic" ABIs in a (relatively) uniform way, +// so we failed to fix up arguments for actually passing through the ABI... +#![feature(rust_cold_cc)] +pub extern "rust-cold" fn foo(_: [usize; 3]) {} |
