Rollup merge of #100437 - compiler-errors:better-const-mismatch-err, r=oli-obk
Improve const mismatch `FulfillmentError` Fixes #100414
This commit is contained in:
commit
26c86c6993
16 changed files with 194 additions and 45 deletions
|
@ -1588,9 +1588,14 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
Mismatch::Variable(infer::ExpectedFound { expected, found }),
|
||||
)
|
||||
}
|
||||
ValuePairs::Terms(infer::ExpectedFound {
|
||||
expected: ty::Term::Const(_),
|
||||
found: ty::Term::Const(_),
|
||||
}) => (false, Mismatch::Fixed("constant")),
|
||||
ValuePairs::TraitRefs(_) | ValuePairs::PolyTraitRefs(_) => {
|
||||
(false, Mismatch::Fixed("trait"))
|
||||
}
|
||||
ValuePairs::Regions(_) => (false, Mismatch::Fixed("lifetime")),
|
||||
_ => (false, Mismatch::Fixed("type")),
|
||||
};
|
||||
let vals = match self.values_str(values) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue