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> {
3953
3953
candidate_impls : & [ ImplCandidate < ' tcx > ] ,
3954
3954
span : Span ,
3955
3955
) {
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 {
3959
3961
return ;
3960
3962
} ;
3961
3963
You can’t perform that action at this time.
0 commit comments