about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-11-20 13:34:24 -0500
committerNiko Matsakis <niko@alum.mit.edu>2017-11-20 13:34:24 -0500
commit2151e482acee9a8715a4bde3cfd477c4ecc20b0b (patch)
treea75869a0d2d49e4150d607a3a56ef035171924a5
parentdf6fdbc9ae333faf7963470d0a27cf3ed4f24f65 (diff)
downloadrust-2151e482acee9a8715a4bde3cfd477c4ecc20b0b.tar.gz
rust-2151e482acee9a8715a4bde3cfd477c4ecc20b0b.zip
fix example for E0644
-rw-r--r--src/librustc/diagnostics.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc/diagnostics.rs b/src/librustc/diagnostics.rs
index 9b0483d00a4..fe3f1bbbe8c 100644
--- a/src/librustc/diagnostics.rs
+++ b/src/librustc/diagnostics.rs
@@ -1982,10 +1982,9 @@ fn fix<F>(f: &F)
 }
 
 fn main() {
-  let x = |y| {
+  fix(&|y| {
     // Here, when `x` is called, the parameter `y` is equal to `x`.
-  };
-  fix(&x);
+  });
 }
 ```