From 1792ef6ae4f51a45b157c69c5e34e0b48770dd56 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Mon, 15 Jun 2015 13:18:07 -0400 Subject: [PATCH] Clarify that the following will error Fixes #26268 --- src/doc/trpl/closures.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/trpl/closures.md b/src/doc/trpl/closures.md index 428897821cfcc..ce52ea5d690cc 100644 --- a/src/doc/trpl/closures.md +++ b/src/doc/trpl/closures.md @@ -120,7 +120,7 @@ let y = &mut num; ``` If your closure requires it, however, Rust will take ownership and move -the environment instead: +the environment instead. This doesn’t work: ```rust,ignore let nums = vec![1, 2, 3]; @@ -130,7 +130,7 @@ let takes_nums = || nums; println!("{:?}", nums); ``` -This gives us: +We get this error: ```text note: `nums` moved into closure environment here because it has type