about summary refs log tree commit diff
path: root/src/libcore/ops/function.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2019-07-25 10:11:03 -0700
committerEsteban Küber <esteban@kuber.com.ar>2019-07-25 10:11:03 -0700
commit3ab60264b504c1f51b2a9e3dfa20ef0d03bcdaed (patch)
treea922e98344f3cc316df05a21817add45b089570f /src/libcore/ops/function.rs
parent03f19f7ff128a3b01eeab3f87f04cce22883f006 (diff)
downloadrust-3ab60264b504c1f51b2a9e3dfa20ef0d03bcdaed.tar.gz
rust-3ab60264b504c1f51b2a9e3dfa20ef0d03bcdaed.zip
Add note suggesting to borrow a String argument to find
Diffstat (limited to 'src/libcore/ops/function.rs')
-rw-r--r--src/libcore/ops/function.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs
index c69f5fd9896..b9552eaa1a0 100644
--- a/src/libcore/ops/function.rs
+++ b/src/libcore/ops/function.rs
@@ -137,6 +137,10 @@ pub trait Fn<Args> : FnMut<Args> {
 #[rustc_paren_sugar]
 #[rustc_on_unimplemented(
     on(Args="()", note="wrap the `{Self}` in a closure with no arguments: `|| {{ /* code */ }}"),
+    on(
+        all(Args="(char,)", _Self="std::string::String"),
+        note="borrowing the `{Self}` might fix the problem"
+    ),
     message="expected a `{FnMut}<{Args}>` closure, found `{Self}`",
     label="expected an `FnMut<{Args}>` closure, found `{Self}`",
 )]