diff options
| author | est31 <MTest31@outlook.com> | 2016-11-13 17:55:17 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2016-11-13 17:55:17 +0100 |
| commit | 34f33ec789297716995045f7067aeb4d77947d89 (patch) | |
| tree | 4e13e4439d4ded36a14848432bf4e4b0b7736331 /src/libsyntax/parse/parser.rs | |
| parent | 1e9aad752beb789df4f2232adf6b9a24efbdac8d (diff) | |
| download | rust-34f33ec789297716995045f7067aeb4d77947d89.tar.gz rust-34f33ec789297716995045f7067aeb4d77947d89.zip | |
Fix empty lifetime list or one with trailing comma being rejected
Fixes #37733
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b80aa667be6..064c93c2866 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1943,12 +1943,12 @@ impl<'a> Parser<'a> { if let Some(recv) = followed_by_ty_params { assert!(recv.is_empty()); *recv = attrs; - } else { + debug!("parse_lifetime_defs ret {:?}", res); + return Ok(res); + } else if !attrs.is_empty() { let msg = "trailing attribute after lifetime parameters"; return Err(self.fatal(msg)); } - debug!("parse_lifetime_defs ret {:?}", res); - return Ok(res); } } |
