diff options
| author | Michael Goulet <michael@errs.io> | 2024-05-13 10:00:38 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-05-13 11:59:42 -0400 |
| commit | 3bcdf3058ef3eaef5042661cf8301acfbcddce65 (patch) | |
| tree | 3f91249a55f4a965a51ca35dce52e63b55aa398b /compiler/rustc_smir/src | |
| parent | ecbe3fd550fccd2cba17ea7e86539bf3e0bfc618 (diff) | |
| download | rust-3bcdf3058ef3eaef5042661cf8301acfbcddce65.tar.gz rust-3bcdf3058ef3eaef5042661cf8301acfbcddce65.zip | |
split out AliasTy -> AliasTerm
Diffstat (limited to 'compiler/rustc_smir/src')
| -rw-r--r-- | compiler/rustc_smir/src/rustc_smir/convert/ty.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs index c442d33cf86..ec44b4c16fe 100644 --- a/compiler/rustc_smir/src/rustc_smir/convert/ty.rs +++ b/compiler/rustc_smir/src/rustc_smir/convert/ty.rs @@ -9,7 +9,7 @@ use stable_mir::ty::{ use crate::rustc_smir::{alloc, Stable, Tables}; -impl<'tcx> Stable<'tcx> for ty::AliasKind { +impl<'tcx> Stable<'tcx> for ty::AliasTyKind { type T = stable_mir::ty::AliasKind; fn stable(&self, _: &mut Tables<'_>) -> Self::T { match self { @@ -29,6 +29,14 @@ impl<'tcx> Stable<'tcx> for ty::AliasTy<'tcx> { } } +impl<'tcx> Stable<'tcx> for ty::AliasTerm<'tcx> { + type T = stable_mir::ty::AliasTerm; + fn stable(&self, tables: &mut Tables<'_>) -> Self::T { + let ty::AliasTerm { args, def_id, .. } = self; + stable_mir::ty::AliasTerm { def_id: tables.alias_def(*def_id), args: args.stable(tables) } + } +} + impl<'tcx> Stable<'tcx> for ty::DynKind { type T = stable_mir::ty::DynKind; @@ -715,9 +723,9 @@ impl<'tcx> Stable<'tcx> for ty::ProjectionPredicate<'tcx> { type T = stable_mir::ty::ProjectionPredicate; fn stable(&self, tables: &mut Tables<'_>) -> Self::T { - let ty::ProjectionPredicate { projection_ty, term } = self; + let ty::ProjectionPredicate { projection_term: projection_ty, term } = self; stable_mir::ty::ProjectionPredicate { - projection_ty: projection_ty.stable(tables), + projection_term: projection_ty.stable(tables), term: term.unpack().stable(tables), } } |
