From c8aa67d9498f042295182cda3919fac729d3b81e Mon Sep 17 00:00:00 2001 From: Gary Guo Date: Wed, 19 Feb 2025 13:29:50 +0000 Subject: [PATCH] Apply editorial suggestions from code review Co-authored-by: Alice Ryhl --- src/inline-assembly.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inline-assembly.md b/src/inline-assembly.md index e301f28d4..48c1fc0b4 100644 --- a/src/inline-assembly.md +++ b/src/inline-assembly.md @@ -359,7 +359,7 @@ r[asm.operand-type.supported-operands.label] - The address of the block is substituted into the asm template string. The assembly code may jump to the substituted address. - After execution of the block, the `asm!` expression returns. - The type of the block must be unit or `!` (never). - - 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. + - The block starts a new safety context: unsafe operations within the `label` block must be wrapped in an inner `unsafe` block, even though the entire `asm!` statement is already wrapped in `unsafe`. ```rust # #[cfg(target_arch = "x86_64")] @@ -1331,7 +1331,7 @@ r[asm.rules.arm64ec] r[asm.rules.only-on-exit] - The requirement of restoring the stack pointer and non-output registers to their original value only applies when exiting the assembly code. - - This means that assembly code that never return (even if not marked `noreturn`) don't need to preserve these registers. + - This means that assembly code that never returns (even if not marked `noreturn`) doesn't need to preserve these registers. - When returning to a different `asm!` block than you entered (e.g. for context switching), these registers must contain the value they had upon entering the `asm!` block that you are *exiting*. - You cannot exit an `asm!` block that has not been entered. Neither can you exit an `asm!` block that has already been exited (without first entering it again).