Skip to content

Commit 7dc9ee3

Browse files
committed
use footnotes instead of \* in as description
1 parent e64212e commit 7dc9ee3

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/expressions/operator-expr.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -460,29 +460,29 @@ reference types and `mut` or `const` in pointer types.
460460
| Enumeration | Integer type | Enum cast |
461461
| `bool` or `char` | Integer type | Primitive to integer cast |
462462
| `u8` | `char` | `u8` to `char` cast |
463-
| `*T` | `*V` where `V: Sized` \* | Pointer to pointer cast |
463+
| `*T` | `*V` [^1] | Pointer to pointer cast |
464464
| `*T` where `T: Sized` | Integer type | Pointer to address cast |
465465
| Integer type | `*V` where `V: Sized` | Address to pointer cast |
466-
| `&m₁ [T; n]` | `*m₂ T` \*\* | Array to pointer cast |
467-
| `*m₁ [T; n]` | `*m₂ T` \*\* | Array to pointer cast |
466+
| `&m₁ [T; n]` | `*m₂ T` [^2] | Array to pointer cast |
467+
| `*m₁ [T; n]` | `*m₂ T` [^2] | Array to pointer cast |
468468
| [Function item] | [Function pointer] | Function item to function pointer cast |
469469
| [Function item] | `*V` where `V: Sized` | Function item to pointer cast |
470470
| [Function item] | Integer | Function item to address cast |
471471
| [Function pointer] | `*V` where `V: Sized` | Function pointer to pointer cast |
472472
| [Function pointer] | Integer | Function pointer to address cast |
473-
| Closure \*\*\* | Function pointer | Closure to function pointer cast |
473+
| Closure [^3] | Function pointer | Closure to function pointer cast |
474474

475-
\* or `T` and `V` are unsized types with compatible metadata:
475+
[^1]: where `T` and `V` have compatible metadata:
476+
* `V: Sized`, or
477+
* Both slice metadata (`*[u16]` -> `*[u8]`, `*str` -> `*(u8, [u32])`), or
478+
* Both the same trait object metadata, modulo dropping auto traits (`*dyn Debug` -> `*(u16, dyn Debug)`, `*dyn Debug + Send` -> `*dyn Debug`)
479+
* **Note**: *adding* auto traits is only allowed if the principal trait has the auto trait as a super trait (given `trait T: Send {}`, `*dyn T` -> `*dyn T + Send` is valid, but `*dyn Debug` -> `*dyn Debug + Send` is not)
480+
* **Note**: Generics (including lifetimes) must match (`*dyn T<'a, A>` -> `*dyn T<'b, B>` requires `'a = 'b` and `A = B`)
476481

477-
* Both slice metadata (`*[u16]` -> `*[u8]`, `*str` -> `*(u8, [u32])`).
478-
* Both the same trait object metadata, modulo dropping auto traits (`*dyn Debug` -> `*(u16, dyn Debug)`, `*dyn Debug + Send` -> `*dyn Debug`).
479-
* **Note**: Adding auto traits is only allowed if the principal trait has the auto trait as a super trait (given `trait T: Send {}`, `*dyn T` -> `*dyn T + Send` is valid, but `*dyn Debug` -> `*dyn Debug + Send` is not).
480-
* **Note**: Generics (including lifetimes) must match (`*dyn T<'a, A>` -> `*dyn T<'b, B>` requires `'a = 'b` and `A = B`).
481-
482-
\*\* only when `m₁` is `mut` or `m₂` is `const`. Casting `mut` reference to
482+
[^2]: only when `m₁` is `mut` or `m₂` is `const`. Casting `mut` reference/pointer to
483483
`const` pointer is allowed.
484484

485-
\*\*\* only for closures that do not capture (close over) any local variables
485+
[^3]: only for closures that do not capture (close over) any local variables can be casted to function pointers.
486486

487487
### Semantics
488488

0 commit comments

Comments
 (0)