Rollup merge of #93728 - JulianKnodt:toterm, r=oli-obk
Add in ValuePair::Term This adds in an enum when matching on positions which can either be types or consts. It will default to emitting old special cased error messages for types. r? `@oli-obk` cc `@matthiaskrgr` Fixes #93578
This commit is contained in:
commit
25ce315c76
6 changed files with 74 additions and 69 deletions
|
@ -1382,26 +1382,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
|
|||
normalized_ty,
|
||||
data.term,
|
||||
) {
|
||||
values = Some(match (normalized_ty, data.term) {
|
||||
(ty::Term::Ty(normalized_ty), ty::Term::Ty(ty)) => {
|
||||
infer::ValuePairs::Types(ExpectedFound::new(
|
||||
is_normalized_ty_expected,
|
||||
normalized_ty,
|
||||
ty,
|
||||
))
|
||||
}
|
||||
(ty::Term::Const(normalized_ct), ty::Term::Const(ct)) => {
|
||||
infer::ValuePairs::Consts(ExpectedFound::new(
|
||||
is_normalized_ty_expected,
|
||||
normalized_ct,
|
||||
ct,
|
||||
))
|
||||
}
|
||||
(_, _) => span_bug!(
|
||||
obligation.cause.span,
|
||||
"found const or type where other expected"
|
||||
),
|
||||
});
|
||||
values = Some(infer::ValuePairs::Terms(ExpectedFound::new(
|
||||
is_normalized_ty_expected,
|
||||
normalized_ty,
|
||||
data.term,
|
||||
)));
|
||||
err_buf = error;
|
||||
err = &err_buf;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue