Reject raw lifetime followed by \' as well
This commit is contained in:
parent
3f1be1ec7e
commit
1990f15608
3 changed files with 38 additions and 1 deletions
|
@ -715,7 +715,17 @@ impl Cursor<'_> {
|
|||
self.bump();
|
||||
self.bump();
|
||||
self.eat_while(is_id_continue);
|
||||
return RawLifetime;
|
||||
match self.first() {
|
||||
'\'' => {
|
||||
// Check if after skipping literal contents we've met a closing
|
||||
// single quote (which means that user attempted to create a
|
||||
// string with single quotes).
|
||||
self.bump();
|
||||
let kind = Char { terminated: true };
|
||||
return Literal { kind, suffix_start: self.pos_within_token() };
|
||||
}
|
||||
_ => return RawLifetime,
|
||||
}
|
||||
}
|
||||
|
||||
// Either a lifetime or a character literal with
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue