diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2014-05-02 14:04:26 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2014-05-03 13:53:07 -0400 |
| commit | 5fe2f01dee7794dc30aee7ceabf2b9e3fba25cca (patch) | |
| tree | c07b6374681ccbaadc6d1330bd2fa6d5783b6426 /src/libsyntax/parse | |
| parent | e97d4e6c190764de1240c2e8a5ac253a60faac6b (diff) | |
| download | rust-5fe2f01dee7794dc30aee7ceabf2b9e3fba25cca.tar.gz rust-5fe2f01dee7794dc30aee7ceabf2b9e3fba25cca.zip | |
Temporary patch to accept arbitrary lifetimes (behind feature gate) in bound lists. This is needed to bootstrap fix for #5723.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5d8443b64d5..1917ea2dafb 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -12,7 +12,7 @@ use abi; use ast::{BareFnTy, ClosureTy}; -use ast::{RegionTyParamBound, TraitTyParamBound}; +use ast::{StaticRegionTyParamBound, OtherRegionTyParamBound, TraitTyParamBound}; use ast::{Provided, Public, FnStyle}; use ast::{Mod, BiAdd, Arg, Arm, Attribute, BindByRef, BindByValue}; use ast::{BiBitAnd, BiBitOr, BiBitXor, Block}; @@ -3351,7 +3351,7 @@ impl<'a> Parser<'a> { token::LIFETIME(lifetime) => { let lifetime_interned_string = token::get_ident(lifetime); if lifetime_interned_string.equiv(&("static")) { - result.push(RegionTyParamBound); + result.push(StaticRegionTyParamBound); if allow_any_lifetime && ret_lifetime.is_none() { ret_lifetime = Some(ast::Lifetime { id: ast::DUMMY_NODE_ID, @@ -3366,8 +3366,7 @@ impl<'a> Parser<'a> { name: lifetime.name }); } else { - self.span_err(self.span, - "`'static` is the only permissible region bound here"); + result.push(OtherRegionTyParamBound(self.span)); } self.bump(); } |
