Auto merge of #113659 - ericmarkmartin:smir-refs-and-ptrs, r=spastorino
Add ty convs for smir refs and ptrs r? `@spastorino`
This commit is contained in:
commit
0f16bd341e
@ -119,8 +119,12 @@ 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 }) => {
|
||||||
ty::Ref(_, _, _) => todo!(),
|
TyKind::RigidTy(RigidTy::RawPtr(self.intern_ty(*ty), mutbl.stable()))
|
||||||
|
}
|
||||||
|
ty::Ref(region, ty, mutbl) => {
|
||||||
|
TyKind::RigidTy(RigidTy::Ref(opaque(region), self.intern_ty(*ty), mutbl.stable()))
|
||||||
|
}
|
||||||
ty::FnDef(_, _) => todo!(),
|
ty::FnDef(_, _) => todo!(),
|
||||||
ty::FnPtr(_) => todo!(),
|
ty::FnPtr(_) => todo!(),
|
||||||
ty::Dynamic(_, _, _) => todo!(),
|
ty::Dynamic(_, _, _) => todo!(),
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::rustc_internal::Opaque;
|
use crate::stable_mir::ty::Region;
|
||||||
use crate::stable_mir::{self, ty::Ty};
|
use crate::stable_mir::{self, ty::Ty};
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
@ -137,8 +137,6 @@ pub enum Statement {
|
|||||||
Nop,
|
Nop,
|
||||||
}
|
}
|
||||||
|
|
||||||
type Region = Opaque;
|
|
||||||
|
|
||||||
// FIXME this is incomplete
|
// FIXME this is incomplete
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum Rvalue {
|
pub enum Rvalue {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use super::{with, DefId};
|
use super::{mir::Mutability, with, DefId};
|
||||||
use crate::rustc_internal::Opaque;
|
use crate::rustc_internal::Opaque;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
@ -11,7 +11,7 @@ impl Ty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Const = Opaque;
|
type Const = Opaque;
|
||||||
type Region = Opaque;
|
pub(crate) type Region = Opaque;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub enum TyKind {
|
pub enum TyKind {
|
||||||
@ -29,6 +29,8 @@ pub enum RigidTy {
|
|||||||
Str,
|
Str,
|
||||||
Array(Ty, Const),
|
Array(Ty, Const),
|
||||||
Slice(Ty),
|
Slice(Ty),
|
||||||
|
RawPtr(Ty, Mutability),
|
||||||
|
Ref(Region, Ty, Mutability),
|
||||||
Tuple(Vec<Ty>),
|
Tuple(Vec<Ty>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user