1
Fork 0

Actually create ranged int types in the type system.

This commit is contained in:
Oli Scherer 2023-02-02 13:57:36 +00:00
parent 6b24a9cf70
commit 84acfe86de
97 changed files with 1208 additions and 77 deletions

View file

@ -99,6 +99,12 @@ impl Ty {
}
}
/// Represents a pattern in the type system
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum Pattern {
Range { start: Option<Const>, end: Option<Const>, include_end: bool },
}
/// Represents a constant in MIR or from the Type system.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Const {
@ -481,6 +487,7 @@ pub enum RigidTy {
Foreign(ForeignDef),
Str,
Array(Ty, Const),
Pat(Ty, Pattern),
Slice(Ty),
RawPtr(Ty, Mutability),
Ref(Region, Ty, Mutability),

View file

@ -139,6 +139,7 @@ impl Visitable for RigidTy {
t.visit(visitor)?;
c.visit(visitor)
}
RigidTy::Pat(t, _p) => t.visit(visitor),
RigidTy::Slice(inner) => inner.visit(visitor),
RigidTy::RawPtr(ty, _) => ty.visit(visitor),
RigidTy::Ref(reg, ty, _) => {