Skip to content

Commit fba96cc

Browse files
authored
Merge pull request #878 from lzutao/fn-items-casting
Add casting rules from function items to other types
2 parents 73ca198 + 29d7e4b commit fba96cc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/expressions/operator-expr.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,11 @@ well as the following additional casts. Here `*T` means either `*const T` or
347347
| `*T` where `T: Sized` | Numeric type | Pointer to address cast |
348348
| Integer type | `*V` where `V: Sized` | Address to pointer cast |
349349
| `&[T; n]` | `*const T` | Array to pointer cast |
350-
| [Function pointer](../types/function-pointer.md) | `*V` where `V: Sized` | Function pointer to pointer cast |
351-
| Function pointer | Integer | Function pointer to address cast |
350+
| [Function item] | [Function pointer] | Function item to function pointer cast |
351+
| [Function item] | `*V` where `V: Sized` | Function item to pointer cast |
352+
| [Function item] | Integer | Function item to address cast |
353+
| [Function pointer] | `*V` where `V: Sized` | Function pointer to pointer cast |
354+
| [Function pointer] | Integer | Function pointer to address cast |
352355
| Closure \*\* | Function pointer | Closure to function pointer cast |
353356

354357
\* or `T` and `V` are compatible unsized types, e.g., both slices, both the
@@ -458,6 +461,8 @@ assert_eq!(x, 14);
458461
[temporary value]: ../expressions.md#temporaries
459462
[float-float]: https://github.com/rust-lang/rust/issues/15536
460463
[`unit` type]: ../types/tuple.md
464+
[Function pointer]: ../types/function-pointer.md
465+
[Function item]: ../types/function-item.md
461466

462467
[_BorrowExpression_]: #borrow-operators
463468
[_DereferenceExpression_]: #the-dereference-operator

0 commit comments

Comments
 (0)