Skip to content

Commit 556eb41

Browse files
author
Kyle Strand
committed
Merge branch 'master' of https://github.com/rust-lang/reference into c-unwind-documentation
2 parents 6c2cd1a + 683bfe5 commit 556eb41

File tree

4 files changed

+21
-26
lines changed

4 files changed

+21
-26
lines changed

src/const_eval.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ to be run.
4242
* The [dereference operator] except for raw pointers.
4343
* [Grouped] expressions.
4444
* [Cast] expressions, except
45-
* pointer to address casts,
46-
* function pointer to address casts, and
47-
* unsizing casts to trait objects.
45+
* pointer to address casts and
46+
* function pointer to address casts.
4847
* Calls of [const functions] and const methods.
4948
* [loop], [while] and [`while let`] expressions.
5049
* [if], [`if let`] and [match] expressions.

src/inline-assembly.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The following ABNF specifies the general syntax:
4141
```text
4242
format_string := STRING_LITERAL / RAW_STRING_LITERAL
4343
dir_spec := "in" / "out" / "lateout" / "inout" / "inlateout"
44-
reg_spec := <register class> / "<explicit register>"
44+
reg_spec := <register class> / "\"" <explicit register> "\""
4545
operand_expr := expr / "_" / expr "=>" expr / expr "=>" "_"
4646
reg_operand := dir_spec "(" reg_spec ")" operand_expr
4747
operand := reg_operand
@@ -162,6 +162,7 @@ Here is the list of currently supported register classes:
162162
| x86 | `kreg0` | `k0` | Only clobbers |
163163
| x86 | `x87_reg` | `st([0-7])` | Only clobbers |
164164
| x86 | `mmx_reg` | `mm[0-7]` | Only clobbers |
165+
| x86-64 | `tmm_reg` | `tmm[0-7]` | Only clobbers |
165166
| AArch64 | `reg` | `x[0-30]` | `r` |
166167
| AArch64 | `vreg` | `v[0-31]` | `w` |
167168
| AArch64 | `vreg_low16` | `v[0-15]` | `x` |
@@ -185,7 +186,7 @@ Here is the list of currently supported register classes:
185186
>
186187
> - On x86-64 the high byte registers (e.g. `ah`) are not available in the `reg_byte` register class.
187188
>
188-
> - Some register classes are marked as "Only clobbers" which means that they cannot be used for inputs or outputs, only clobbers of the form `out("reg") _` or `lateout("reg") _`.
189+
> - Some register classes are marked as "Only clobbers" which means that registers in these classes cannot be used for inputs or outputs, only clobbers of the form `out(<explicit register>) _` or `lateout(<explicit register>) _`.
189190
190191
Each register class has constraints on which value types they can be used with.
191192
This is necessary because the way a value is loaded into a register depends on its type.
@@ -204,6 +205,7 @@ The availability of supported types for a particular register class may depend o
204205
| x86 | `kreg` | `avx512bw` | `i32`, `i64` |
205206
| x86 | `mmx_reg` | N/A | Only clobbers |
206207
| x86 | `x87_reg` | N/A | Only clobbers |
208+
| x86 | `tmm_reg` | N/A | Only clobbers |
207209
| AArch64 | `reg` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
208210
| AArch64 | `vreg` | `neon` | `i8`, `i16`, `i32`, `f32`, `i64`, `f64`, <br> `i8x8`, `i16x4`, `i32x2`, `i64x1`, `f32x2`, `f64x1`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
209211
| AArch64 | `preg` | N/A | Only clobbers |
@@ -356,7 +358,7 @@ If all references to an operand already have modifiers then the warning is suppr
356358
## ABI clobbers
357359

358360
The `clobber_abi` keyword can be used to apply a default set of clobbers to an `asm!` block.
359-
This will automatically insert the necessary clobber constraints as needed for calling a function with a particular calling convention: if the calling convention does not fully preserve the value of a register across a call then a `lateout("reg") _` is implicitly added to the operands list.
361+
This will automatically insert the necessary clobber constraints as needed for calling a function with a particular calling convention: if the calling convention does not fully preserve the value of a register across a call then `lateout("...") _` is implicitly added to the operands list (where the `...` is replaced by the register's name).
360362

361363
`clobber_abi` may be specified any number of times. It will insert a clobber for all unique registers in the union of all specified calling conventions.
362364

@@ -367,8 +369,8 @@ The following ABIs can be used with `clobber_abi`:
367369
| Architecture | ABI name | Clobbered registers |
368370
| ------------ | -------- | ------------------- |
369371
| x86-32 | `"C"`, `"system"`, `"efiapi"`, `"cdecl"`, `"stdcall"`, `"fastcall"` | `ax`, `cx`, `dx`, `xmm[0-7]`, `mm[0-7]`, `k[0-7]`, `st([0-7])` |
370-
| x86-64 | `"C"`, `"system"` (on Windows), `"efiapi"`, `"win64"` | `ax`, `cx`, `dx`, `r[8-11]`, `xmm[0-31]`, `mm[0-7]`, `k[0-7]`, `st([0-7])` |
371-
| x86-64 | `"C"`, `"system"` (on non-Windows), `"sysv64"` | `ax`, `cx`, `dx`, `si`, `di`, `r[8-11]`, `xmm[0-31]`, `mm[0-7]`, `k[0-7]`, `st([0-7])` |
372+
| x86-64 | `"C"`, `"system"` (on Windows), `"efiapi"`, `"win64"` | `ax`, `cx`, `dx`, `r[8-11]`, `xmm[0-31]`, `mm[0-7]`, `k[0-7]`, `st([0-7])`, `tmm[0-7]` |
373+
| x86-64 | `"C"`, `"system"` (on non-Windows), `"sysv64"` | `ax`, `cx`, `dx`, `si`, `di`, `r[8-11]`, `xmm[0-31]`, `mm[0-7]`, `k[0-7]`, `st([0-7])`, `tmm[0-7]` |
372374
| AArch64 | `"C"`, `"system"`, `"efiapi"` | `x[0-17]`, `x18`\*, `x30`, `v[0-31]`, `p[0-15]`, `ffr` |
373375
| ARM | `"C"`, `"system"`, `"efiapi"`, `"aapcs"` | `r[0-3]`, `r12`, `r14`, `s[0-15]`, `d[0-7]`, `d[16-31]` |
374376
| RISC-V | `"C"`, `"system"`, `"efiapi"` | `x1`, `x[5-7]`, `x[10-17]`, `x[28-31]`, `f[0-7]`, `f[10-17]`, `f[28-31]`, `v[0-31]` |

src/names/namespaces.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The following is a list of namespaces, with their corresponding entities:
5050
* [Attribute macros]
5151
* Lifetime Namespace
5252
* [Generic lifetime parameters]
53-
* Label Namespace[^rustc-lifetime-shadow]
53+
* Label Namespace
5454
* [Loop labels]
5555

5656
An example of how overlapping names in different namespaces can be used unambiguously:
@@ -115,12 +115,6 @@ For example, the [`cfg` attribute] and the [`cfg` macro] are two different entit
115115

116116
It is still an error for a [`use` import] to shadow another macro, regardless of their sub-namespaces.
117117

118-
[^rustc-lifetime-shadow]: `rustc` currently warns about shadowing when using
119-
the same name for a label and lifetime in the same scope, but it still
120-
treats them independently. This is intended as a future-compatibility
121-
warning about a possible extension to the language. See [PR
122-
#24162](https://github.com/rust-lang/rust/pull/24162).
123-
124118
[`cfg` attribute]: ../conditional-compilation.md#the-cfg-attribute
125119
[`cfg` macro]: ../conditional-compilation.md#the-cfg-macro
126120
[`for`]: ../expressions/loop-expr.md#iterator-loops

src/tokens.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ Literals are tokens used in [literal expressions].
2424

2525
#### Characters and strings
2626

27-
| | Example | `#` sets | Characters | Escapes |
28-
|----------------------------------------------|-----------------|-------------|-------------|---------------------|
29-
| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
30-
| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
31-
| [Raw string](#raw-string-literals) | `r#"hello"#` | 0 or more\* | All Unicode | `N/A` |
32-
| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
33-
| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
34-
| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | 0 or more\* | All ASCII | `N/A` |
27+
| | Example | `#` sets\* | Characters | Escapes |
28+
|----------------------------------------------|-----------------|------------|-------------|---------------------|
29+
| [Character](#character-literals) | `'H'` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
30+
| [String](#string-literals) | `"hello"` | 0 | All Unicode | [Quote](#quote-escapes) & [ASCII](#ascii-escapes) & [Unicode](#unicode-escapes) |
31+
| [Raw string](#raw-string-literals) | `r#"hello"#` | <256 | All Unicode | `N/A` |
32+
| [Byte](#byte-literals) | `b'H'` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
33+
| [Byte string](#byte-string-literals) | `b"hello"` | 0 | All ASCII | [Quote](#quote-escapes) & [Byte](#byte-escapes) |
34+
| [Raw byte string](#raw-byte-string-literals) | `br#"hello"#` | <256 | All ASCII | `N/A` |
3535

36-
\* The number of `#`s on each side of the same literal must be equivalent
36+
\* The number of `#`s on each side of the same literal must be equivalent.
3737

3838
#### ASCII escapes
3939

@@ -193,7 +193,7 @@ following forms:
193193
> &nbsp;&nbsp; | `#` RAW_STRING_CONTENT `#`
194194
195195
Raw string literals do not process any escapes. They start with the character
196-
`U+0072` (`r`), followed by zero or more of the character `U+0023` (`#`) and a
196+
`U+0072` (`r`), followed by fewer than 256 of the character `U+0023` (`#`) and a
197197
`U+0022` (double-quote) character. The _raw string body_ can contain any sequence
198198
of Unicode characters and is terminated only by another `U+0022` (double-quote)
199199
character, followed by the same number of `U+0023` (`#`) characters that preceded
@@ -284,7 +284,7 @@ following forms:
284284
> &nbsp;&nbsp; _any ASCII (i.e. 0x00 to 0x7F)_
285285
286286
Raw byte string literals do not process any escapes. They start with the
287-
character `U+0062` (`b`), followed by `U+0072` (`r`), followed by zero or more
287+
character `U+0062` (`b`), followed by `U+0072` (`r`), followed by fewer than 256
288288
of the character `U+0023` (`#`), and a `U+0022` (double-quote) character. The
289289
_raw string body_ can contain any sequence of ASCII characters and is terminated
290290
only by another `U+0022` (double-quote) character, followed by the same number of

0 commit comments

Comments
 (0)