1
Fork 0

add RawPtr

This commit is contained in:
Eric Mark Martin 2023-07-13 00:23:22 -04:00
parent 285920ea2d
commit 08e89acd2e
2 changed files with 6 additions and 1 deletions

View file

@ -119,7 +119,9 @@ impl<'tcx> Tables<'tcx> {
TyKind::RigidTy(RigidTy::Array(self.intern_ty(*ty), opaque(constant))) TyKind::RigidTy(RigidTy::Array(self.intern_ty(*ty), opaque(constant)))
} }
ty::Slice(ty) => TyKind::RigidTy(RigidTy::Slice(self.intern_ty(*ty))), ty::Slice(ty) => TyKind::RigidTy(RigidTy::Slice(self.intern_ty(*ty))),
ty::RawPtr(_) => todo!(), ty::RawPtr(ty::TypeAndMut { ty, mutbl }) => {
TyKind::RigidTy(RigidTy::RawPtr(self.intern_ty(*ty), mutbl.stable()))
}
ty::Ref(_, _, _) => todo!(), ty::Ref(_, _, _) => todo!(),
ty::FnDef(_, _) => todo!(), ty::FnDef(_, _) => todo!(),
ty::FnPtr(_) => todo!(), ty::FnPtr(_) => todo!(),

View file

@ -20,6 +20,8 @@ pub enum TyKind {
RigidTy(RigidTy), RigidTy(RigidTy),
} }
type Region = Opaque;
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum RigidTy { pub enum RigidTy {
Bool, Bool,
@ -31,6 +33,7 @@ pub enum RigidTy {
Str, Str,
Array(Ty, Const), Array(Ty, Const),
Slice(Ty), Slice(Ty),
RawPtr(Ty, Mutability),
Tuple(Vec<Ty>), Tuple(Vec<Ty>),
} }