File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
compiler/rustc_trait_selection/src/traits/error_reporting Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -3953,9 +3953,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
39533953 candidate_impls : & [ ImplCandidate < ' tcx > ] ,
39543954 span : Span ,
39553955 ) {
3956- // We can only suggest the slice coersion for function arguments since the suggestion
3957- // would make no sense in turbofish or call
3958- let ObligationCauseCode :: FunctionArgumentObligation { .. } = obligation. cause . code ( ) else {
3956+ // We can only suggest the slice coersion for function and binary operation arguments,
3957+ // since the suggestion would make no sense in turbofish or call
3958+ let ( ObligationCauseCode :: BinOp { .. }
3959+ | ObligationCauseCode :: FunctionArgumentObligation { .. } ) = obligation. cause . code ( )
3960+ else {
39593961 return ;
39603962 } ;
39613963
You can’t perform that action at this time.
0 commit comments