about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-11-18 00:05:38 +0000
committerbors <bors@rust-lang.org>2019-11-18 00:05:38 +0000
commit361791bb5fdd714bdc39f8af835f6468dd18331d (patch)
tree6eeebf53b94743a431cb0b901f6c14c7a7093948 /src/libcore
parent0f0c640e0ee5a9ad365e78e3c62239b3d65b7045 (diff)
parent2fe8371268b36193fa4dc8461341db90f4ec96b9 (diff)
downloadrust-361791bb5fdd714bdc39f8af835f6468dd18331d.tar.gz
rust-361791bb5fdd714bdc39f8af835f6468dd18331d.zip
Auto merge of #65456 - estebank:trait-bound-borrow, r=matthewjasper
Suggest borrowing when it would satisfy an unmet trait bound

When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.

Fix #56368.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/ops/function.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs
index 4a0a2720fe4..35790324a2f 100644
--- a/src/libcore/ops/function.rs
+++ b/src/libcore/ops/function.rs
@@ -137,10 +137,6 @@ 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}`",
 )]