Skip to content

Commit 41c9c9b

Browse files
author
Timothée Delabrouille
committed
precisions on the authorized labels + typo
1 parent e5fe9eb commit 41c9c9b

File tree

1 file changed

+2
-2
lines changed
  • src/doc/unstable-book/src/library-features

1 file changed

+2
-2
lines changed

src/doc/unstable-book/src/library-features/asm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ unsafe {
376376

377377
The compiler is allowed to instantiate multiple copies an `asm!` block, for example when the function containing it is inlined in multiple places. As a consequence, you should only use GNU assembler [local labels] inside inline assembly code. Defining symbols in assembly code may lead to assembler and/or linker errors due to duplicate symbol definitions.
378378

379-
Moreover due to [a llvm bug], you cannot use `0` or `1` as labels. Therefore only labels in the `2`-`99` range are allowed.
379+
Moreover, due to [an llvm bug], you shouldn't use labels exclusively make of `0` and `1` digits, e.g. `0`, `11` or `101010`, as they may end up being interpreted as binary values.
380380

381381
```rust
382382
#![feature(asm)]
@@ -407,7 +407,7 @@ First that the same number can be used as a label multiple times in the same inl
407407
Second, that when a numeric label is used as a reference (as an instruction operand, for example), the suffixes b (“backward”) or f (“forward”) should be added to the numeric label. It will then refer to the nearest label defined by this number in this direction.
408408

409409
[local labels]: https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Labels
410-
[a llvm bug]: https://bugs.llvm.org/show_bug.cgi?id=36144
410+
[an llvm bug]: https://bugs.llvm.org/show_bug.cgi?id=36144
411411

412412
## Options
413413

0 commit comments

Comments
 (0)