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

@ -553,7 +553,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
}
fn is_self_referential_projection(&self, p: ty::PolyProjectionPredicate<'tcx>) -> bool {
if let Some(ty) = p.term().skip_binder().ty() {
if let Some(ty) = p.term().skip_binder().as_type() {
matches!(ty.kind(), ty::Alias(ty::Projection, proj) if proj == &p.skip_binder().projection_term.expect_ty(self.tcx))
} else {
false