diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-04-07 13:30:48 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-04-08 00:03:11 -0700 |
| commit | c3ea3e439fbc5251279d914a95cd8344556982cb (patch) | |
| tree | c179b27b1d04dd7bfa17ab59b695c91fcd64320f /src/libsyntax | |
| parent | c83afb9719ad6e2ae7d819b8096524e1147c4065 (diff) | |
| download | rust-c3ea3e439fbc5251279d914a95cd8344556982cb.tar.gz rust-c3ea3e439fbc5251279d914a95cd8344556982cb.zip | |
Register new snapshots
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast_util.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/deriving/generic.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 49 |
3 files changed, 21 insertions, 36 deletions
diff --git a/src/libsyntax/ast_util.rs b/src/libsyntax/ast_util.rs index 631489a65b2..ec9c02ac82a 100644 --- a/src/libsyntax/ast_util.rs +++ b/src/libsyntax/ast_util.rs @@ -613,7 +613,7 @@ pub trait EachViewItem { } struct EachViewItemData<'a> { - callback: 'a |&ast::ViewItem| -> bool, + callback: |&ast::ViewItem|: 'a -> bool, } impl<'a> Visitor<()> for EachViewItemData<'a> { diff --git a/src/libsyntax/ext/deriving/generic.rs b/src/libsyntax/ext/deriving/generic.rs index 0d851647b3d..1dcb753624d 100644 --- a/src/libsyntax/ext/deriving/generic.rs +++ b/src/libsyntax/ext/deriving/generic.rs @@ -303,7 +303,7 @@ Combine the values of all the fields together. The last argument is all the fields of all the structures, see above for details. */ pub type CombineSubstructureFunc<'a> = - 'a |&mut ExtCtxt, Span, &Substructure| -> @Expr; + |&mut ExtCtxt, Span, &Substructure|: 'a -> @Expr; /** Deal with non-matching enum variants, the arguments are a list @@ -311,10 +311,10 @@ representing each variant: (variant index, ast::Variant instance, [variant fields]), and a list of the nonself args of the type */ pub type EnumNonMatchFunc<'a> = - 'a |&mut ExtCtxt, + |&mut ExtCtxt, Span, &[(uint, P<ast::Variant>, Vec<(Span, Option<Ident>, @Expr)> )], - &[@Expr]| + &[@Expr]|: 'a -> @Expr; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 62ce0f1e113..c8ea0b6aac2 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -905,31 +905,23 @@ impl<'a> Parser<'a> { */ - // NOTE: remove after the next stage0 snap - let (decl, lifetimes, bounds) = if self.token == token::COLON { - let (_, bounds) = self.parse_optional_ty_param_bounds(false); - let (decl, lifetimes) = self.parse_ty_fn_decl(false); - (decl, lifetimes, bounds) + let lifetimes = if self.eat(&token::LT) { + let lifetimes = self.parse_lifetimes(); + self.expect_gt(); + lifetimes } else { - let lifetimes = if self.eat(&token::LT) { - let lifetimes = self.parse_lifetimes(); - self.expect_gt(); - lifetimes - } else { - Vec::new() - }; - - let (inputs, variadic) = self.parse_fn_args(false, false); - let (_, bounds) = self.parse_optional_ty_param_bounds(false); - let (ret_style, ret_ty) = self.parse_ret_ty(); - let decl = P(FnDecl { - inputs: inputs, - output: ret_ty, - cf: ret_style, - variadic: variadic - }); - (decl, lifetimes, bounds) + Vec::new() }; + + let (inputs, variadic) = self.parse_fn_args(false, false); + let (_, bounds) = self.parse_optional_ty_param_bounds(false); + let (ret_style, ret_ty) = self.parse_ret_ty(); + let decl = P(FnDecl { + inputs: inputs, + output: ret_ty, + cf: ret_style, + variadic: variadic + }); TyClosure(@ClosureTy { sigil: OwnedSigil, region: None, @@ -957,8 +949,6 @@ impl<'a> Parser<'a> { */ - // NOTE: remove 'let region' after a stage0 snap - let region = self.parse_opt_lifetime(); let purity = self.parse_unsafety(); let onceness = if self.eat_keyword(keywords::Once) {Once} else {Many}; @@ -982,10 +972,7 @@ impl<'a> Parser<'a> { inputs }; - let (new_region, bounds) = self.parse_optional_ty_param_bounds(true); - - // NOTE: this should be removed after a stage0 snap - let region = new_region.or(region); + let (region, bounds) = self.parse_optional_ty_param_bounds(true); let (return_style, output) = self.parse_ret_ty(); let decl = P(FnDecl { @@ -1246,9 +1233,7 @@ impl<'a> Parser<'a> { } else if self.token_is_closure_keyword() || self.token == token::BINOP(token::OR) || self.token == token::OROR || - self.token == token::LT || - // NOTE: remove this clause after a stage0 snap - Parser::token_is_lifetime(&self.token) { + self.token == token::LT { // CLOSURE // // FIXME(pcwalton): Eventually `token::LT` will not unambiguously |
