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

@@ -259,7 +259,7 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
obligations.len = ?self.obligations.len(),
"AssocTypeNormalizer: normalized type"
);
normalized_ty.ty().unwrap()
normalized_ty.expect_type()
}
ty::Projection => {
@@ -289,7 +289,7 @@ impl<'a, 'b, 'tcx> TypeFolder<TyCtxt<'tcx>> for AssocTypeNormalizer<'a, 'b, 'tcx
)
.ok()
.flatten()
.map(|term| term.ty().unwrap())
.map(|term| term.expect_type())
.map(|normalized_ty| {
PlaceholderReplacer::replace_placeholders(
infcx,