Annotate some bugs

This commit is contained in:
Michael Goulet
2023-12-15 03:19:46 +00:00
parent 96df494340
commit 70b9dad3dc
34 changed files with 295 additions and 197 deletions

View File

@@ -203,7 +203,11 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
)
.into(),
ty::AssocKind::Type => Ty::new_error(tcx, guar).into(),
ty::AssocKind::Fn => unreachable!(),
// This makes no sense...
ty::AssocKind::Fn => span_bug!(
tcx.def_span(assoc_def.item.def_id),
"cannot project to an associated function"
),
};
ecx.eq(goal.param_env, goal.predicate.term, error_term)
.expect("expected goal term to be fully unconstrained");

View File

@@ -256,7 +256,10 @@ impl<'tcx> assembly::GoalKind<'tcx> for TraitPredicate<'tcx> {
Err(NoSolution)
}
}
ty::ImplPolarity::Reservation => bug!(),
// FIXME: Goal polarity should be split from impl polarity
ty::ImplPolarity::Reservation => {
bug!("we never expect a `Reservation` polarity in a trait goal")
}
}
}