Commit graph

58 commits

Author SHA1 Message Date
Folkert de Vries
df0bdea545
cmse: additional argument passing tests 2026-02-05 19:32:21 +01:00
Folkert de Vries
43ee28aa16
cmse: don't use BackendRepr when checking return type 2026-02-05 19:32:20 +01:00
Esteban Küber
20fabb48b9 Use return type Span on async fns instead of whole fn def Span 2025-12-09 16:46:33 +00:00
Antoni Boucher
2a88ea1892 Bless tests 2025-12-05 09:51:27 -05:00
Antoni Boucher
ea0995a91a Ignore failing GCC test 2025-12-05 09:51:27 -05:00
Matthias Krüger
02434fe718
Rollup merge of #148678 - xonx4l:EO412_replacement_with_EO425, r=Kivooeo
Merge E0412 into E0425

This PR merge E0412 into E0425  as both mean the same thing to users.

This fixes https://github.com/rust-lang/rust/issues/148558.
2025-12-02 22:02:30 +01:00
xonx4l
4b000cfacd Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
Folkert de Vries
06658ab84b
cmse: do not calculate the layout of a type with infer types 2025-11-24 13:26:24 +01:00
Folkert de Vries
4fd0dc1050
move NonNull into minicore 2025-11-16 13:13:18 +01:00
Folkert de Vries
4e9dfb5d3b
cmse: add test for async and const functions
async functions are disallowed (because `-> impl Trait` is not supported). `const` entry functions are allowed, nonsecure-call functions must be function pointers, which cannot be evaluated during constant evaluation.
2025-11-05 17:06:39 +01:00
Ralf Jung
3796f7de57 compiletest: rename add-core-stubs to add-minicore 2025-11-02 16:20:06 +01:00
Guillaume Gomez
a8051a6ca3 Ignore more failing ui tests for GCC backend 2025-10-13 15:30:26 +02:00
Folkert de Vries
760ea07840
cmse: more accurate span for generic arguments 2025-10-08 16:36:45 +02:00
Folkert de Vries
98d3864310
cmse: rephrase error message when signature uses generics 2025-10-08 16:36:45 +02:00
Folkert de Vries
b47de64cdb
cmse: rephrase error message when types don't fit 2025-10-08 16:36:18 +02:00
Folkert de Vries
f4d8bd3b47
cmse: more accurate spans for excess parameters
Use the span of the types that don't fit, rather than the span of the
whole signature.
2025-10-08 16:21:50 +02:00
Folkert de Vries
f62be66e94
cmse: additional impl Trait tests 2025-10-08 13:25:12 +02:00
Matthias Krüger
7ab1fd1816
Rollup merge of #147243 - folkertdev:cmse-bail-impl-trait, r=davidtwco
cmse: disallow `impl Trait` in `cmse-nonsecure-entry` return types

tracking issue: https://github.com/rust-lang/rust/issues/75835
fixes https://github.com/rust-lang/rust/issues/147242

Refactors some logic to be more robust in the future, and then disallows `impl Trait` as a return type for the cmse ABIs.

The `is_valid_cmse_output_layout` function disallows `union` values like before. That is not entirely correct, but preserves the current behavior. Some additional logic is needed for `union` values (and any types where parts may be uninitialized) that I'll tackle in a later PR.

can be reviewed commit-by-commit.

r? types
2025-10-07 17:42:11 +02:00
Folkert de Vries
fbdc685ed0
cmse: disallow impl Trait in cmse-nonsecure-entry return types 2025-10-07 17:31:08 +02:00
Zalathar
e6429c7454 Don't create a top-level true directory when running UI tests 2025-10-01 21:13:20 +10:00
Stuart Cook
5a6ac8c322
Rollup merge of #146649 - folkertdev:cmse-call-erase-regions, r=lcnr
cmse: fix 'region variables should not be hashed'

tracking issue: https://github.com/rust-lang/rust/issues/81391
fixes https://github.com/rust-lang/rust/issues/131639

Some background: the `cmse-nonsecure-call` calling convention is used for a call from "secure" to "non-secure" code. To make sure that "non-secure" cannot read any secrets, restrictions are put on the signatures of functions with this calling convention: they can only use 4 arguments for passing arguments, and one register for passing a result. No arguments are passed via the stack, and all other registers are cleared before the call.

We check during `hir_ty_lowering` that the signature follows these rules. We do that by determining and then inspecting the layout of the type. That works well overall, but can run into asserts when the type itself is ill-formed. This PR fixes one such case.

I believe that the fix here, just erasing the regions, is the right shape, but there may be some nuance that I'm missing.

r? types
2025-09-30 22:25:16 +10:00
Folkert de Vries
401857aaa1
cmse: fix 'region variables should not be hashed' 2025-09-16 20:30:37 +02:00
Folkert de Vries
8b752cb37d
fix issue with cmse-nonsecure-entry ABI being both async and c-variadic 2025-09-16 10:23:07 +02:00
Folkert de Vries
9196844f0d
c-variadic: reject functions with unsupported extern ABI 2025-09-09 21:38:38 +02:00
Folkert de Vries
2912efa879
c-variadic: update cmse-nonsecure example 2025-09-08 19:18:22 +02:00
Ralf Jung
f6d55aea2c stabilize extended_varargs_abi_support 2025-09-02 08:48:12 +02:00
Jubilee Young
02a00dfbe4 tests: bless s/C-cmse/cmse/ 2025-06-25 00:52:11 -07:00
Jubilee Young
1400e2d9f5 tests: s/C-cmse/cmse/ 2025-06-25 00:52:10 -07:00
Jubilee Young
0dd29e1a86 tests: Update and bless cmse-nonsecure ABI tests 2025-06-23 09:40:00 -07:00
Ralf Jung
963fdbc852 variadic functions: remove list of supported ABIs from error 2025-06-13 18:10:06 +02:00
Tamme Dittrich
2bf5cc93e6 Bless UI tests 2025-03-03 08:52:07 +01:00
David Wood
92eb4450fa
tests: use minicore more
minicore makes it much easier to add new language items to all of the
existing `no_core` tests.
2025-02-24 09:26:54 +00:00
Jacob Pratt
36d37966df
Rollup merge of #136948 - workingjubilee:split-off-extern-system-varargs, r=compiler-errors
Split out the `extern_system_varargs` feature

After the stabilization PR was opened, `extern "system"` functions were added to `extended_varargs_abi_support`. This has a number of questions regarding it that were not discussed and were somewhat surprising. It deserves to be considered as its own feature, separate from `extended_varargs_abi_support`.

Tracking issue:
- https://github.com/rust-lang/rust/issues/136946
2025-02-13 03:53:32 -05:00
Jubilee Young
4bb0c3da2c Split out the extern_system_varargs feature
After the stabilization PR was opened, `extern "system"` functions were
added to `extended_varargs_abi_support`. This has a number of questions
regarding it that were not discussed and were somewhat surprising.
It deserves to be considered as its own feature, separate from
`extended_varargs_abi_support`.
2025-02-12 19:57:45 -08:00
Michael Goulet
c72d443cdd Use core stubs in some CMSE tests 2025-02-13 03:43:47 +00:00
Jubilee Young
d97bde059a Revert "Stabilize extended_varargs_abi_support"
This reverts commit 685f189b43.
2025-02-11 17:22:27 -08:00
bors
c182ce9cbc Auto merge of #136845 - matthiaskrgr:rollup-ol4np4z, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #136107 (Introduce CoercePointeeWellformed for coherence checks at typeck stage)
 - #136155 (Enable sanitizers on MSVC CI jobs)
 - #136524 (Delay bug when method confirmation cannot upcast object pick of self)
 - #136584 (Prevent generic pattern types from being used in libstd)
 - #136603 (compiler: gate `extern "{abi}"` in ast_lowering)
 - #136821 (assign marcoieni and jdno to infra-ci PRs)
 - #136825 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-02-11 05:27:49 +00:00
Esteban Küber
f0845adb0c Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
2025-02-10 20:21:39 +00:00
Jubilee Young
ca193471b5 tests: error strings for ABI stability now match 2025-02-09 20:45:47 -08:00
León Orell Valerian Liehr
0b18b4fbbc
Remove all dead files inside tests/ui/ 2025-01-27 02:28:04 +01:00
Soveu
685f189b43 Stabilize extended_varargs_abi_support 2024-11-27 22:21:33 +01:00
Folkert de Vries
10aa255541 improve error messages for C-cmse-nonsecure-entry functions 2024-10-14 22:32:32 +02:00
Tamme Dittrich
47293c1234 Check ABI target compatibility for function pointers
This check was previously only performed on functions not function pointers.

Co-authored-by: Folkert <folkert@folkertdev.nl>
2024-09-23 14:04:22 +02:00
Folkert
4d75a4f0f2 disallow cmse ABIs on unsupported platforms 2024-09-21 13:05:23 +02:00
Folkert
a33dcb3607 add test that accepts a C-cmse-nonsecure-call function pointer 2024-09-21 13:05:23 +02:00
Folkert
5722a80782 remove #[cmse_nonsecure_entry] 2024-09-21 13:05:21 +02:00
Folkert de Vries
46115fd6d3 fix ICE in CMSE type validation 2024-09-07 10:53:59 +02:00
Folkert
c2894a4297
improve error reporting 2024-07-18 14:32:10 +02:00
Folkert
7b63734961
move CMSE validation to hir_analysis 2024-07-18 12:42:40 +02:00
Folkert
8a3dd7fb5f
add test for unions and repr(transparent) with ZST fields 2024-07-17 21:21:33 +02:00