1
Fork 0

enable suggest convert to slice for binary operation

This commit is contained in:
yukang 2023-08-04 00:14:13 +08:00
parent 3635b48973
commit cde8f06503

View file

@ -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;
}; };