From 3a860554144bfb4e6e711f012c1d7ecaec28fc3f Mon Sep 17 00:00:00 2001 From: Aaron McDaid Date: Wed, 17 Nov 2021 15:00:05 +0100 Subject: [PATCH] Update closures.md --- closures.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/closures.md b/closures.md index 7fb2f17..4d3e7a3 100644 --- a/closures.md +++ b/closures.md @@ -402,7 +402,8 @@ by the compiler, no annotation is necessary). If a variable is moved into a closure, i.e., it is captured by value (either because of an explicit `move` or due to inference), then the closure will have a `FnOnce` type. It would be unsafe to call such a closure multiple times because the captured variable would be -moved more than once. +moved more than once; this is because the moving happens at the time the closure +is called, not at the time the closure is constructed. Rust will do its best to infer the most flexible type for the closure if it can.