Align Term methods with GenericArg methods

This commit is contained in:
Michael Goulet
2024-05-29 22:23:49 -04:00
parent 7c52d2db63
commit 273b990554
23 changed files with 46 additions and 36 deletions

View File

@@ -726,7 +726,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ReplaceProjectionWith<'_, 'tcx> {
)
.expect("expected to be able to unify goal projection with dyn's projection"),
);
proj.term.ty().unwrap()
proj.term.expect_type()
} else {
ty.super_fold_with(self)
}

View File

@@ -17,7 +17,7 @@ impl<'tcx> EvalCtxt<'_, InferCtxt<'tcx>> {
) -> QueryResult<'tcx> {
let tcx = self.interner();
let opaque_ty = goal.predicate.alias;
let expected = goal.predicate.term.ty().expect("no such thing as an opaque const");
let expected = goal.predicate.term.as_type().expect("no such thing as an opaque const");
match (goal.param_env.reveal(), self.solver_mode()) {
(Reveal::UserFacing, SolverMode::Normal) => {