Skip to content

Commit 1f3607e

Browse files
traviscrossnbdd0121
authored andcommitted
Make some editorial adjustments
1 parent 2af3b8c commit 1f3607e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/inline-assembly.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,10 @@ assert_eq!(y, [3, 2, 0, 1]);
356356

357357
r[asm.operand-type.supported-operands.label]
358358
* `label <block>`
359-
- The address of the block is substituted into the asm template string. The assembly block may jump to the substituted addresses.
359+
- The address of the block is substituted into the asm template string. The assembly block may jump to the substituted address.
360360
- After execution of the block, the `asm!` expression returns.
361361
- The type of the block must be unit or `!` (never).
362-
- The block starts new safety context; despite the outer `unsafe` needed for `asm!`, you need an extra `unsafe` to perform unsafe operations inside the block.
362+
- The block starts a new safety context; despite the outer `unsafe` block needed for `asm!`, unsafe operations within the `label` block must be wrapped in an inner `unsafe` block.
363363

364364
```rust
365365
# #[cfg(target_arch = "x86_64")]
@@ -1097,8 +1097,8 @@ r[asm.options.supported-options.noreturn]
10971097
- `noreturn`: The `asm!` block never returns, and its return type is defined as `!` (never).
10981098
Behavior is undefined if execution falls through past the end of the asm code.
10991099
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.
1100-
- When labels are present, `noreturn` means the execution of the `asm!` block never falls through; the asm block may only exit by jumping to one of the specified blocks.
1101-
The entire `asm!` block will have unit type in this case, unless all label blocks diverge, in which case the return type is `!`.
1100+
- When any `label` blocks are present, `noreturn` means the execution of the `asm!` block never falls through; the asm block may only exit by jumping to one of the specified blocks.
1101+
The entire `asm!` block will have unit type in this case, unless all `label` blocks diverge, in which case the return type is `!`.
11021102

11031103
<!-- no_run: This test aborts at runtime -->
11041104
```rust,no_run
@@ -1186,7 +1186,7 @@ r[asm.options.checks.noreturn]
11861186
- It is a compile-time error to specify `noreturn` on an asm block with outputs and without labels.
11871187

11881188
r[asm.options.checks.label-with-outputs]
1189-
- It is a compile-time error to specify label on an asm block with outputs.
1189+
- It is a compile-time error to have any `label` blocks in an asm block with outputs.
11901190

11911191
```rust,compile_fail
11921192
# #[cfg(target_arch = "x86_64")] {

0 commit comments

Comments
 (0)