diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-06-24 15:09:57 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-06-24 15:09:57 -0700 |
| commit | 487cbf8e906f73589df9501004abeb570b24f121 (patch) | |
| tree | 7203f78ddc8930c8627966e2d292d7237c1a4a6d /src/libsyntax/parse | |
| parent | 60a748a1d8e9631df9b04235881917c0a80c9e03 (diff) | |
| download | rust-487cbf8e906f73589df9501004abeb570b24f121.tar.gz rust-487cbf8e906f73589df9501004abeb570b24f121.zip | |
Remove resources
Also fixed shapes for classes with dtors, as well as handling offsets for classes with dtors correctly in take glue. Closes #2485
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 25 | ||||
| -rw-r--r-- | src/libsyntax/parse/token.rs | 3 |
2 files changed, 1 insertions, 27 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 46e838fd4be..2196ae9d4be 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1917,29 +1917,6 @@ class parser { (ident, item_impl(tps, rp, ifce, ty, meths), none) } - fn parse_item_res() -> item_info { - let ident = self.parse_value_ident(); - let rp = self.parse_region_param(); - let ty_params = self.parse_ty_params(); - self.expect(token::LPAREN); - let arg_ident = self.parse_value_ident(); - self.expect(token::COLON); - let t = self.parse_ty(false); - self.expect(token::RPAREN); - let dtor = self.parse_block_no_value(); - let decl = { - inputs: [{mode: expl(by_ref), ty: t, - ident: arg_ident, id: self.get_id()}], - output: @{id: self.get_id(), node: ty_nil, - span: ast_util::dummy_sp()}, - purity: impure_fn, - cf: return_val, - constraints: [] - }; - (ident, item_res(decl, ty_params, dtor, - self.get_id(), self.get_id(), rp), none) - } - // Instantiates ident <i> with references to <typarams> as arguments. // Used to create a path that refers to a class which will be defined as // the return type of the ctor function. @@ -2341,8 +2318,6 @@ class parser { self.parse_item_iface() } else if self.eat_keyword("impl") { self.parse_item_impl() - } else if self.eat_keyword("resource") { - self.parse_item_res() } else if self.eat_keyword("class") { self.parse_item_class() } else { ret none; }; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 39327f1efad..478d7f53658 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -293,8 +293,7 @@ fn restricted_keyword_table() -> hashmap<str, ()> { "let", "log", "loop", "mod", "mut", "native", "new", - "pure", - "resource", "ret", + "pure", "ret", "true", "trait", "type", "unchecked", "unsafe", "while" |
