Skip to content

Commit 393e54b

Browse files
committed
coercions.md: non-capturing closures to function pointers
1 parent 6e57e64 commit 393e54b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/coercions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Coercion is allowed between the following types:
1818
* `&mut T` to `*mut T`
1919
* Unsizing: `T` to `U` if `T` implements `CoerceUnsized<U>`
2020
* Deref coercion: Expression `&x` of type `&T` to `&*x` of type `&U` if `T` derefs to `U` (i.e. `T: Deref<Target=U>`)
21+
* Non-capturing closure to a function pointer ([RFC 1558](https://rust-lang.github.io/rfcs/1558-closure-to-fn-coercion.html)), e.g. `|| 8usize` to `fn() -> usize`
2122

2223
`CoerceUnsized<Pointer<U>> for Pointer<T> where T: Unsize<U>` is implemented
2324
for all pointer types (including smart pointers like Box and Rc). Unsize is

0 commit comments

Comments
 (0)