Do not suggest adjusting trait signature on type mismatch
This commit is contained in:
parent
0f7ef1a202
commit
d1ab6c2ae3
@ -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 => {
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user