File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
tests/ui/cmse-nonsecure/cmse-nonsecure-entry Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ async unsafe extern "cmse-nonsecure-entry" fn async_and_c_variadic(_: ...) {
2121 //~| ERROR functions cannot be both `async` and C-variadic
2222}
2323
24+ // Async on its own is also not allowed.
25+ async unsafe extern "cmse-nonsecure-entry" fn async_is_not_allowed ( ) {
26+ //~^ ERROR `impl Trait` is not allowed in `extern "cmse-nonsecure-entry"` signatures
27+ }
28+
2429// Below are the lang items that are required for a program that defines an `async` function.
2530// Without them, the ICE that is tested for here is not reached for this target. For now they are in
2631// this file, but they may be moved into `minicore` if/when other `#[no_core]` tests want to use
Original file line number Diff line number Diff line change @@ -24,5 +24,12 @@ LL | async unsafe extern "cmse-nonsecure-entry" fn async_and_c_variadic(_: ...)
2424 |
2525 = help: only `extern "C"` and `extern "C-unwind"` functions may have a C variable argument list
2626
27- error: aborting due to 3 previous errors
27+ error[E0798]: `impl Trait` is not allowed in `extern "cmse-nonsecure-entry"` signatures
28+ --> $DIR/c-variadic.rs:25:1
29+ |
30+ LL | async unsafe extern "cmse-nonsecure-entry" fn async_is_not_allowed() {
31+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+ error: aborting due to 4 previous errors
2834
35+ For more information about this error, try `rustc --explain E0798`.
Original file line number Diff line number Diff line change @@ -89,3 +89,13 @@ extern "cmse-nonsecure-entry" fn identity_impl_trait_nested(
8989 //~^ ERROR `impl Trait` is not allowed in `extern "cmse-nonsecure-entry"` signatures
9090 v
9191}
92+
93+ const extern "cmse-nonsecure-entry" fn const_fn_works ( x : u8 ) -> u8 {
94+ x
95+ }
96+
97+ const CONST : u8 = const_fn_works ( 0 ) ;
98+
99+ fn fn_ptr_works ( f : extern "cmse-nonsecure-entry" fn ( _: u8 ) -> u8 ) -> u8 {
100+ f ( 0 )
101+ }
You can’t perform that action at this time.
0 commit comments