Skip to content

Commit af9dd20

Browse files
committed
Disallow lifetime followed immediately by single quote
1 parent 247e127 commit af9dd20

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/parse.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,11 @@ fn digits(mut input: Cursor) -> Result<Cursor, LexError> {
716716
fn op(input: Cursor) -> PResult<Punct> {
717717
match op_char(input) {
718718
Ok((rest, '\'')) => {
719-
ident(rest)?;
720-
Ok((rest, Punct::new('\'', Spacing::Joint)))
719+
if ident(rest)?.0.starts_with("'") {
720+
Err(LexError)
721+
} else {
722+
Ok((rest, Punct::new('\'', Spacing::Joint)))
723+
}
721724
}
722725
Ok((rest, ch)) => {
723726
let kind = match op_char(rest) {

0 commit comments

Comments
 (0)