about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-06-10 22:51:00 +0000
committerMichael Goulet <michael@errs.io>2023-06-28 17:51:01 +0000
commitd1ab6c2ae3fa0726d5f8b5a92b66faa09c72b893 (patch)
tree4022815f46a74873fd3d0640806737084edc253f /compiler/rustc_trait_selection/src
parent0f7ef1a202b32f783b3e0e05d318208c0c83b8d0 (diff)
downloadrust-d1ab6c2ae3fa0726d5f8b5a92b66faa09c72b893.tar.gz
rust-d1ab6c2ae3fa0726d5f8b5a92b66faa09c72b893.zip
Do not suggest adjusting trait signature on type mismatch
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
index 7efef2364a6..73a45322c4f 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -3959,6 +3959,10 @@ fn hint_missing_borrow<'tcx>(
     found_node: Node<'_>,
     err: &mut Diagnostic,
 ) {
+    if matches!(found_node, Node::TraitItem(..)) {
+        return;
+    }
+
     let found_args = match found.kind() {
         ty::FnPtr(f) => infcx.instantiate_binder_with_placeholders(*f).inputs().iter(),
         kind => {