about summary refs log tree commit diff
path: root/src/libsyntax/ast.rs
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2014-04-03 13:38:45 +1300
committerNick Cameron <ncameron@mozilla.com>2014-04-23 12:30:58 +1200
commitf78add10cde772b9d743a84a604dc584b63a06fc (patch)
treebc159ccd2a18de0a71e4163e48b64cc31ae9dbcb /src/libsyntax/ast.rs
parentc3b2f2b0c6f074fb98add56a1977d407e294c9ed (diff)
downloadrust-f78add10cde772b9d743a84a604dc584b63a06fc.tar.gz
rust-f78add10cde772b9d743a84a604dc584b63a06fc.zip
Support unsized types with the `type` keyword
Diffstat (limited to 'src/libsyntax/ast.rs')
-rw-r--r--src/libsyntax/ast.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 5d0b24fdb3e..97ddff78789 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -180,6 +180,7 @@ pub enum TyParamBound {
 pub struct TyParam {
     pub ident: Ident,
     pub id: NodeId,
+    pub sized: Sized,
     pub bounds: OwnedSlice<TyParamBound>,
     pub default: Option<P<Ty>>,
     pub span: Span
@@ -1052,6 +1053,12 @@ impl Visibility {
 }
 
 #[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
+pub enum Sized {
+    DynSize,
+    StaticSize,
+}
+
+#[deriving(Clone, Eq, TotalEq, Encodable, Decodable, Hash)]
 pub struct StructField_ {
     pub kind: StructFieldKind,
     pub id: NodeId,
@@ -1109,7 +1116,7 @@ pub enum Item_ {
     ItemTy(P<Ty>, Generics),
     ItemEnum(EnumDef, Generics),
     ItemStruct(@StructDef, Generics),
-    ItemTrait(Generics, Vec<TraitRef> , Vec<TraitMethod> ),
+    ItemTrait(Generics, Sized, Vec<TraitRef> , Vec<TraitMethod> ),
     ItemImpl(Generics,
              Option<TraitRef>, // (optional) trait this impl implements
              P<Ty>, // self