diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2021-06-24 16:25:44 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2021-06-24 23:42:15 +0100 |
| commit | d0443bb7c2c42d03e7a329e2e18eef779bd2e0e9 (patch) | |
| tree | baec681a45de19b8b31ef187b89e0ed1119911a3 /src/doc | |
| parent | 1e13a9bb33debb931d603278b7f1a706b0d11660 (diff) | |
| download | rust-d0443bb7c2c42d03e7a329e2e18eef779bd2e0e9.tar.gz rust-d0443bb7c2c42d03e7a329e2e18eef779bd2e0e9.zip | |
Add a "raw" option for asm! which ignores format string specifiers
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/library-features/asm.md | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/doc/unstable-book/src/library-features/asm.md b/src/doc/unstable-book/src/library-features/asm.md index 5503b3b4b32..2456beba486 100644 --- a/src/doc/unstable-book/src/library-features/asm.md +++ b/src/doc/unstable-book/src/library-features/asm.md @@ -455,7 +455,7 @@ reg_spec := <register class> / "<explicit register>" operand_expr := expr / "_" / expr "=>" expr / expr "=>" "_" reg_operand := dir_spec "(" reg_spec ")" operand_expr operand := reg_operand / "const" const_expr / "sym" path -option := "pure" / "nomem" / "readonly" / "preserves_flags" / "noreturn" / "nostack" / "att_syntax" +option := "pure" / "nomem" / "readonly" / "preserves_flags" / "noreturn" / "nostack" / "att_syntax" / "raw" options := "options(" option *["," option] [","] ")" asm := "asm!(" format_string *("," format_string) *("," [ident "="] operand) ["," options] [","] ")" ``` @@ -775,6 +775,7 @@ Currently the following options are defined: - `noreturn`: The `asm` block never returns, and its return type is defined as `!` (never). Behavior is undefined if execution falls through past the end of the asm code. A `noreturn` asm block behaves just like a function which doesn't return; notably, local variables in scope are not dropped before it is invoked. - `nostack`: The `asm` block does not push data to the stack, or write to the stack red-zone (if supported by the target). If this option is *not* used then the stack pointer is guaranteed to be suitably aligned (according to the target ABI) for a function call. - `att_syntax`: This option is only valid on x86, and causes the assembler to use the `.att_syntax prefix` mode of the GNU assembler. Register operands are substituted in with a leading `%`. +- `raw`: This causes the template string to be parsed as a raw assembly string, with no special handling for `{` and `}`. This is primarily useful when including raw assembly code from an external file using `include_str!`. The compiler performs some additional checks on options: - The `nomem` and `readonly` options are mutually exclusive: it is a compile-time error to specify both. |
