diff options
| author | Michael Goulet <michael@errs.io> | 2023-06-10 22:51:00 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-06-28 17:51:01 +0000 |
| commit | d1ab6c2ae3fa0726d5f8b5a92b66faa09c72b893 (patch) | |
| tree | 4022815f46a74873fd3d0640806737084edc253f /compiler/rustc_trait_selection/src | |
| parent | 0f7ef1a202b32f783b3e0e05d318208c0c83b8d0 (diff) | |
| download | rust-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.rs | 4 |
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 => { |
