Fix w/ comments
This commit is contained in:
parent
c654e4d6f4
commit
78fb74a600
40 changed files with 281 additions and 199 deletions
|
@ -288,13 +288,21 @@ impl<'tcx> ToTrace<'tcx> for &'tcx Const<'tcx> {
|
|||
|
||||
impl<'tcx> ToTrace<'tcx> for ty::Term<'tcx> {
|
||||
fn to_trace(
|
||||
_: TyCtxt<'tcx>,
|
||||
tcx: TyCtxt<'tcx>,
|
||||
cause: &ObligationCause<'tcx>,
|
||||
a_is_expected: bool,
|
||||
a: Self,
|
||||
b: Self,
|
||||
) -> TypeTrace<'tcx> {
|
||||
TypeTrace { cause: cause.clone(), values: Terms(ExpectedFound::new(a_is_expected, a, b)) }
|
||||
match (a, b) {
|
||||
(ty::Term::Ty(a), ty::Term::Ty(b)) => {
|
||||
ToTrace::to_trace(tcx, cause, a_is_expected, a, b)
|
||||
}
|
||||
(ty::Term::Const(a), ty::Term::Const(b)) => {
|
||||
ToTrace::to_trace(tcx, cause, a_is_expected, a, b)
|
||||
}
|
||||
(_, _) => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2127,7 +2127,6 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
infer::Types(exp_found) => self.expected_found_str_ty(exp_found),
|
||||
infer::Regions(exp_found) => self.expected_found_str(exp_found),
|
||||
infer::Consts(exp_found) => self.expected_found_str(exp_found),
|
||||
infer::Terms(exp_found) => self.expected_found_str(exp_found),
|
||||
infer::TraitRefs(exp_found) => {
|
||||
let pretty_exp_found = ty::error::ExpectedFound {
|
||||
expected: exp_found.expected.print_only_trait_path(),
|
||||
|
|
|
@ -371,7 +371,6 @@ pub enum ValuePairs<'tcx> {
|
|||
Types(ExpectedFound<Ty<'tcx>>),
|
||||
Regions(ExpectedFound<ty::Region<'tcx>>),
|
||||
Consts(ExpectedFound<&'tcx ty::Const<'tcx>>),
|
||||
Terms(ExpectedFound<ty::Term<'tcx>>),
|
||||
TraitRefs(ExpectedFound<ty::TraitRef<'tcx>>),
|
||||
PolyTraitRefs(ExpectedFound<ty::PolyTraitRef<'tcx>>),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue