about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-26 23:55:47 +0200
committerGitHub <noreply@github.com>2019-08-26 23:55:47 +0200
commit59fa966a4ddd395ef1b59861d8c8b8152020624e (patch)
tree5a3e58cf26fa5796b0a27f1aad4ffd6cfda62e94
parent9eeb7d566e3279208421ed7e49908511147f2a04 (diff)
parent55f8dde6c89e3af68d4c59232f3d06e6130e9f0a (diff)
downloadrust-59fa966a4ddd395ef1b59861d8c8b8152020624e.tar.gz
rust-59fa966a4ddd395ef1b59861d8c8b8152020624e.zip
Rollup merge of #63845 - DevQps:47091-remove-bad-example, r=nikomatsakis
Removed a confusing FnOnce example

# Description
See #47091 for a discussion.

## Changes
- Removed an example that might suggest readers that square_x is (only) FnOnce.

closes #47091
-rw-r--r--src/libcore/ops/function.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs
index b9552eaa1a0..4a0a2720fe4 100644
--- a/src/libcore/ops/function.rs
+++ b/src/libcore/ops/function.rs
@@ -185,14 +185,6 @@ pub trait FnMut<Args> : FnOnce<Args> {
 ///
 /// # Examples
 ///
-/// ## Calling a by-value closure
-///
-/// ```
-/// let x = 5;
-/// let square_x = move || x * x;
-/// assert_eq!(square_x(), 25);
-/// ```
-///
 /// ## Using a `FnOnce` parameter
 ///
 /// ```