enable suggest convert to slice for binary operation
This commit is contained in:
parent
3635b48973
commit
cde8f06503
1 changed files with 5 additions and 3 deletions
|
@ -3953,9 +3953,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||||
candidate_impls: &[ImplCandidate<'tcx>],
|
candidate_impls: &[ImplCandidate<'tcx>],
|
||||||
span: Span,
|
span: Span,
|
||||||
) {
|
) {
|
||||||
// We can only suggest the slice coersion for function arguments since the suggestion
|
// We can only suggest the slice coersion for function and binary operation arguments,
|
||||||
// would make no sense in turbofish or call
|
// since the suggestion would make no sense in turbofish or call
|
||||||
let ObligationCauseCode::FunctionArgumentObligation { .. } = obligation.cause.code() else {
|
let (ObligationCauseCode::BinOp { .. }
|
||||||
|
| ObligationCauseCode::FunctionArgumentObligation { .. }) = obligation.cause.code()
|
||||||
|
else {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue