diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2024-09-05 13:45:26 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2024-10-06 18:12:25 +0200 |
| commit | 562ec5a6fb469a360b72aa8ba0ce149598cc7975 (patch) | |
| tree | ef26a0c513a413e9a7994389cdfd5796e5a69b68 /compiler/rustc_error_codes/src | |
| parent | 1a9c1cbf367fb2b6f04a0a81d7fae56485e29e7f (diff) | |
| download | rust-562ec5a6fb469a360b72aa8ba0ce149598cc7975.tar.gz rust-562ec5a6fb469a360b72aa8ba0ce149598cc7975.zip | |
disallow `asm!` in `#[naked]` functions
also disallow the `noreturn` option, and infer `naked_asm!` as `!`
Diffstat (limited to 'compiler/rustc_error_codes/src')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0787.md | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0787.md b/compiler/rustc_error_codes/src/error_codes/E0787.md index cee50829270..f5c5faa066b 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0787.md +++ b/compiler/rustc_error_codes/src/error_codes/E0787.md @@ -11,11 +11,10 @@ pub extern "C" fn f() -> u32 { } ``` -The naked functions must be defined using a single inline assembly -block. +The naked function must be defined using a single `naked_asm!` assembly block. The execution must never fall through past the end of the assembly -code so the block must use `noreturn` option. The asm block can also +code, so it must either return or diverge. The asm block can also use `att_syntax` and `raw` options, but others options are not allowed. The asm block must not contain any operands other than `const` and |
