Skip to content

Commit

Permalink
add str, slice, and array to smir types
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmarkmartin committed Jul 14, 2023
1 parent 7bd81ee commit fd5553f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions compiler/rustc_smir/src/rustc_smir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ impl<'tcx> Tables<'tcx> {
),
)),
ty::Foreign(_) => todo!(),
ty::Str => todo!(),
ty::Array(_, _) => todo!(),
ty::Slice(_) => todo!(),
ty::Str => TyKind::RigidTy(RigidTy::Str),
ty::Array(ty, constant) => {
TyKind::RigidTy(RigidTy::Array(self.intern_ty(*ty), opaque(constant)))
}
ty::Slice(ty) => TyKind::RigidTy(RigidTy::Slice(self.intern_ty(*ty))),
ty::RawPtr(_) => todo!(),
ty::Ref(_, _, _) => todo!(),
ty::FnDef(_, _) => todo!(),
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_smir/src/stable_mir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ pub enum RigidTy {
Uint(UintTy),
Float(FloatTy),
Adt(AdtDef, AdtSubsts),
Str,
Array(Ty, Const),
Slice(Ty),
Tuple(Vec<Ty>),
}

Expand Down

0 comments on commit fd5553f

Please sign in to comment.