Actually create ranged int types in the type system.
This commit is contained in:
parent
6b24a9cf70
commit
84acfe86de
97 changed files with 1208 additions and 77 deletions
|
@ -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),
|
||||
|
|
|
@ -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, _) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue