Skip to content

Commit ed33f75

Browse files
committed
pure asm blocks must terminate
1 parent f9f5b5b commit ed33f75

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/inline-assembly.md

+1
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ The list of clobbered registers for each ABI is updated in rustc as architecture
413413
Flags are used to further influence the behavior of the inline assembly block.
414414
Currently the following options are defined:
415415
- `pure`: The `asm!` block has no side effects, and its outputs depend only on its direct inputs (i.e. the values themselves, not what they point to) or values read from memory (unless the `nomem` options is also set).
416+
The `asm!` block must always terminate.
416417
This allows the compiler to execute the `asm!` block fewer times than specified in the program (e.g. by hoisting it out of a loop) or even eliminate it entirely if the outputs are not used.
417418
The `pure` option must be combined with either the `nomem` or `readonly` options, otherwise a compile-time error is emitted.
418419
- `nomem`: The `asm!` blocks does not read or write to any memory.

0 commit comments

Comments
 (0)