Skip to content

Commit 383d761

Browse files
compiler: Trim the misleading C of C-cmse from errors
1 parent 4bdf1c5 commit 383d761

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

compiler/rustc_error_codes/src/error_codes/E0775.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Erroneous code example:
88
```ignore (no longer emitted)
99
#![feature(cmse_nonsecure_entry)]
1010
11-
pub extern "C-cmse-nonsecure-entry" fn entry_function() {}
11+
pub extern "cmse-nonsecure-entry" fn entry_function() {}
1212
```
1313

1414
To fix this error, compile your code for a Rust target that supports the
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
The `C-cmse-nonsecure-call` ABI can only be used with function pointers.
1+
The `cmse-nonsecure-call` ABI can only be used with function pointers.
22

33
Erroneous code example:
44

55
```compile_fail,E0781
6-
#![feature(abi_c_cmse_nonsecure_call)]
6+
#![feature(abi_cmse_nonsecure_call)]
77
8-
pub extern "C-cmse-nonsecure-call" fn test() {}
8+
pub extern "cmse-nonsecure-call" fn test() {}
99
```
1010

11-
The `C-cmse-nonsecure-call` ABI should be used by casting function pointers to
11+
The `cmse-nonsecure-call` ABI should be used by casting function pointers to
1212
specific addresses.

compiler/rustc_error_codes/src/error_codes/E0798.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Functions marked as `C-cmse-nonsecure-call` place restrictions on their
1+
Functions marked as `cmse-nonsecure-call` place restrictions on their
22
inputs and outputs.
33

44
- inputs must fit in the 4 available 32-bit argument registers. Alignment
@@ -12,12 +12,12 @@ see [arm's aapcs32](https://github.com/ARM-software/abi-aa/releases).
1212

1313
Erroneous code example:
1414

15-
```ignore (only fails on supported targets)
16-
#![feature(abi_c_cmse_nonsecure_call)]
15+
```ignore (host errors will not match for target)
16+
#![feature(abi_cmse_nonsecure_call)]
1717
1818
#[no_mangle]
1919
pub fn test(
20-
f: extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32, u32) -> u32,
20+
f: extern "cmse-nonsecure-call" fn(u32, u32, u32, u32, u32) -> u32,
2121
) -> u32 {
2222
f(1, 2, 3, 4, 5)
2323
}
@@ -27,12 +27,12 @@ Arguments' alignment is respected. In the example below, padding is inserted
2727
so that the `u64` argument is passed in registers r2 and r3. There is then no
2828
room left for the final `f32` argument
2929

30-
```ignore (only fails on supported targets)
31-
#![feature(abi_c_cmse_nonsecure_call)]
30+
```ignore (host errors will not match for target)
31+
#![feature(abi_cmse_nonsecure_call)]
3232
3333
#[no_mangle]
3434
pub fn test(
35-
f: extern "C-cmse-nonsecure-call" fn(u32, u64, f32) -> u32,
35+
f: extern "cmse-nonsecure-call" fn(u32, u64, f32) -> u32,
3636
) -> u32 {
3737
f(1, 2, 3.0)
3838
}

compiler/rustc_error_codes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,5 +690,5 @@ E0805: 0805,
690690
// E0723, // unstable feature in `const` context
691691
// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
692692
// E0744, // merged into E0728
693-
// E0776, // Removed; cmse_nonsecure_entry is now `C-cmse-nonsecure-entry`
693+
// E0776, // Removed; `#[cmse_nonsecure_entry]` is now `extern "cmse-nonsecure-entry"`
694694
// E0796, // unused error code. We use `static_mut_refs` lint instead.

compiler/rustc_feature/src/unstable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ declare_features! (
431431
(unstable, closure_lifetime_binder, "1.64.0", Some(97362)),
432432
/// Allows `#[track_caller]` on closures and coroutines.
433433
(unstable, closure_track_caller, "1.57.0", Some(87417)),
434-
/// Allows `extern "C-cmse-nonsecure-entry" fn()`.
434+
/// Allows `extern "cmse-nonsecure-entry" fn()`.
435435
(unstable, cmse_nonsecure_entry, "1.48.0", Some(75835)),
436436
/// Allows `async {}` expressions in const contexts.
437437
(unstable, const_async_blocks, "1.53.0", Some(85368)),

compiler/rustc_hir_analysis/messages.ftl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ hir_analysis_closure_implicit_hrtb = implicit types in closure signatures are fo
7373
.label = `for<...>` is here
7474
7575
hir_analysis_cmse_call_generic =
76-
function pointers with the `"C-cmse-nonsecure-call"` ABI cannot contain generics in their type
76+
function pointers with the `"cmse-nonsecure-call"` ABI cannot contain generics in their type
7777
7878
hir_analysis_cmse_entry_generic =
79-
functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type
79+
functions with the `"cmse-nonsecure-entry"` ABI cannot contain generics in their type
8080
8181
hir_analysis_cmse_inputs_stack_spill =
8282
arguments for `{$abi}` function too large to pass via registers

compiler/rustc_hir_analysis/src/hir_ty_lowering/cmse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub(crate) fn validate_cmse_abi<'tcx>(
3838
dcx,
3939
span,
4040
E0781,
41-
"the `\"C-cmse-nonsecure-call\"` ABI is only allowed on function pointers"
41+
"the `\"cmse-nonsecure-call\"` ABI is only allowed on function pointers"
4242
)
4343
.emit();
4444
return;

0 commit comments

Comments
 (0)