Do not suggest adjusting trait signature on type mismatch

This commit is contained in:
Michael Goulet 2023-06-10 22:51:00 +00:00
parent 0f7ef1a202
commit d1ab6c2ae3
2 changed files with 4 additions and 5 deletions

View File

@ -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 => {

View File

@ -30,11 +30,6 @@ LL | self.map(Insertable::values).unwrap_or_default()
found function signature `for<'a> fn(&'a _) -> _`
note: required by a bound in `Option::<T>::map`
--> $SRC_DIR/core/src/option.rs:LL:COL
help: consider adjusting the signature so it does not borrow its argument
|
LL - fn values(&self) -> Self::Values;
LL + fn values(self) -> Self::Values;
|
error: aborting due to 2 previous errors