You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/expressions/field-expr.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ foo().x;
37
37
## Automatic dereferencing
38
38
39
39
If the type of the container operand implements [`Deref`] or [`DerefMut`][`Deref`] depending on whether the operand is [mutable], it is *automatically dereferenced* as many times as necessary to make the field access possible.
40
-
This processes is also called *autoderef* for short.
40
+
This process is also called *autoderef* for short.
Copy file name to clipboardExpand all lines: src/expressions/if-expr.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ The expression cannot be a [lazy boolean operator expression][_LazyBooleanOperat
129
129
Use of a lazy boolean operator is ambiguous with a planned feature change of the language (the implementation of if-let chains - see [eRFC 2947][_eRFCIfLetChain_]).
130
130
When lazy boolean operator expression is desired, this can be achieved by using parenthesis as below:
| Integer or Float type | Integer or Float type | Numeric cast |
371
-
|C-like enum| Integer type | Enum cast |
371
+
|Enumeration| Integer type | Enum cast |
372
372
|`bool` or `char`| Integer type | Primitive to integer cast |
373
373
|`u8`|`char`|`u8` to `char` cast |
374
374
|`*T`|`*V` where `V: Sized`\*| Pointer to pointer cast |
@@ -430,6 +430,10 @@ halfway between two floating point numbers.
430
430
#### Enum cast
431
431
432
432
Casts an enum to its discriminant, then uses a numeric cast if needed.
433
+
Casting is limited to the following kinds of enumerations:
434
+
435
+
*[Unit-only enums]
436
+
*[Field-less enums] without [explicit discriminants], or where only unit-variants have explicit discriminants
433
437
434
438
#### Primitive to integer cast
435
439
@@ -596,7 +600,7 @@ It will then set the value of the assigned operand's place to the value of perfo
596
600
597
601
> **Note**: This is different than other expressions in that the right operand is evaluated before the left one.
598
602
599
-
Otherwise, this expression is syntactic sugar for calling the function of the overloading compound assigment trait of the operator (see the table earlier in this chapter).
603
+
Otherwise, this expression is syntactic sugar for calling the function of the overloading compound assignment trait of the operator (see the table earlier in this chapter).
600
604
A mutable borrow of the assigned operand is automatically taken.
601
605
602
606
For example, the following expression statements in `example` are equivalent:
@@ -632,6 +636,8 @@ See [this test] for an example of using this dependency.
632
636
633
637
[copies or moves]: ../expressions.md#moved-and-copied-types
0 commit comments