rustc: Implement parsing and typechecking for "once fn"
This commit is contained in:
@@ -1059,6 +1059,25 @@ enum region_ {
|
||||
re_named(ident)
|
||||
}
|
||||
|
||||
#[auto_serialize]
|
||||
#[auto_deserialize]
|
||||
enum Onceness {
|
||||
Once,
|
||||
Many
|
||||
}
|
||||
|
||||
impl Onceness : cmp::Eq {
|
||||
pure fn eq(other: &Onceness) -> bool {
|
||||
match (self, *other) {
|
||||
(Once, Once) | (Many, Many) => true,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
pure fn ne(other: &Onceness) -> bool {
|
||||
!self.eq(other)
|
||||
}
|
||||
}
|
||||
|
||||
#[auto_serialize]
|
||||
#[auto_deserialize]
|
||||
enum ty_ {
|
||||
@@ -1070,7 +1089,7 @@ enum ty_ {
|
||||
ty_ptr(mt),
|
||||
ty_rptr(@region, mt),
|
||||
ty_rec(~[ty_field]),
|
||||
ty_fn(proto, purity, @~[ty_param_bound], fn_decl),
|
||||
ty_fn(proto, purity, Onceness, @~[ty_param_bound], fn_decl),
|
||||
ty_tup(~[@Ty]),
|
||||
ty_path(@path, node_id),
|
||||
ty_fixed_length(@Ty, Option<uint>),
|
||||
|
||||
Reference in New Issue
Block a user