Rollup merge of #112232 - fee1-dead-contrib:match-eq-const-msg, r=b-naber
Better error for non const `PartialEq` call generated by `match` Resolves #90237
This commit is contained in:
commit
31d1fbf8d2
35 changed files with 211 additions and 100 deletions
|
@ -128,7 +128,9 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
|
|||
destination,
|
||||
target: Some(target),
|
||||
unwind: UnwindAction::Continue,
|
||||
from_hir_call: *from_hir_call,
|
||||
call_source: if *from_hir_call { CallSource::Normal } else {
|
||||
CallSource::OverloadedOperator
|
||||
},
|
||||
fn_span: *fn_span,
|
||||
})
|
||||
},
|
||||
|
|
|
@ -173,7 +173,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
destination: storage,
|
||||
target: Some(success),
|
||||
unwind: UnwindAction::Continue,
|
||||
from_hir_call: false,
|
||||
call_source: CallSource::Misc,
|
||||
fn_span: expr_span,
|
||||
},
|
||||
);
|
||||
|
|
|
@ -277,7 +277,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
.ty
|
||||
.is_inhabited_from(this.tcx, this.parent_module, this.param_env)
|
||||
.then_some(success),
|
||||
from_hir_call,
|
||||
call_source: if from_hir_call {
|
||||
CallSource::Normal
|
||||
} else {
|
||||
CallSource::OverloadedOperator
|
||||
},
|
||||
fn_span,
|
||||
},
|
||||
);
|
||||
|
|
|
@ -264,7 +264,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
destination: ref_str,
|
||||
target: Some(eq_block),
|
||||
unwind: UnwindAction::Continue,
|
||||
from_hir_call: false,
|
||||
call_source: CallSource::Misc,
|
||||
fn_span: source_info.span
|
||||
}
|
||||
);
|
||||
|
@ -496,7 +496,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
destination: eq_result,
|
||||
target: Some(eq_block),
|
||||
unwind: UnwindAction::Continue,
|
||||
from_hir_call: false,
|
||||
call_source: CallSource::MatchCmp,
|
||||
fn_span: source_info.span,
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue