diff options
| author | Celina G. Val <celinval@amazon.com> | 2023-12-06 13:45:07 -0800 |
|---|---|---|
| committer | Celina G. Val <celinval@amazon.com> | 2023-12-06 14:26:52 -0800 |
| commit | 281b65aad94cb81b56b2e03359d19d90200fa3ee (patch) | |
| tree | 329201cf5625c0a92d9c7a93c25adfd6e2cb0f9b /compiler/stable_mir/src/compiler_interface.rs | |
| parent | 7a34091eed9adcb079035357ffaf2467b0d377fc (diff) | |
| download | rust-281b65aad94cb81b56b2e03359d19d90200fa3ee.tar.gz rust-281b65aad94cb81b56b2e03359d19d90200fa3ee.zip | |
Add method to get type of an Rvalue in StableMIR
Diffstat (limited to 'compiler/stable_mir/src/compiler_interface.rs')
| -rw-r--r-- | compiler/stable_mir/src/compiler_interface.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/stable_mir/src/compiler_interface.rs b/compiler/stable_mir/src/compiler_interface.rs index d8a3d4eda4b..228ad562167 100644 --- a/compiler/stable_mir/src/compiler_interface.rs +++ b/compiler/stable_mir/src/compiler_interface.rs @@ -87,6 +87,9 @@ pub trait Context { /// Create a new type from the given kind. fn new_rigid_ty(&self, kind: RigidTy) -> Ty; + /// Create a new box type, `Box<T>`, for the given inner type `T`. + fn new_box_ty(&self, ty: Ty) -> Ty; + /// Returns the type of given crate item. fn def_ty(&self, item: DefId) -> Ty; @@ -102,6 +105,9 @@ pub trait Context { /// Obtain the representation of a type. fn ty_kind(&self, ty: Ty) -> TyKind; + // Get the discriminant Ty for this Ty if there's one. + fn rigid_ty_discriminant_ty(&self, ty: &RigidTy) -> Ty; + /// Get the body of an Instance which is already monomorphized. fn instance_body(&self, instance: InstanceDef) -> Option<Body>; |
