mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-16 13:05:18 +03:00
Rollup merge of #51240 - nnethercote:parse-2, r=nikomatsakis
Two minor parsing tweaks
This commit is contained in:
@@ -516,6 +516,7 @@ fn scan_optional_raw_name(&mut self) -> Option<ast::Name> {
|
||||
return None;
|
||||
}
|
||||
let start = self.pos;
|
||||
self.bump();
|
||||
while ident_continue(self.ch) {
|
||||
self.bump();
|
||||
}
|
||||
@@ -1155,6 +1156,7 @@ fn next_token_inner(&mut self) -> Result<token::Token, ()> {
|
||||
}
|
||||
|
||||
let start = self.pos;
|
||||
self.bump();
|
||||
while ident_continue(self.ch) {
|
||||
self.bump();
|
||||
}
|
||||
@@ -1300,11 +1302,7 @@ fn next_token_inner(&mut self) -> Result<token::Token, ()> {
|
||||
}
|
||||
'-' => {
|
||||
self.bump();
|
||||
match self.ch.unwrap_or('\x00') {
|
||||
_ => {
|
||||
Ok(token::LArrow)
|
||||
}
|
||||
}
|
||||
Ok(token::LArrow)
|
||||
}
|
||||
_ => {
|
||||
Ok(token::Lt)
|
||||
|
||||
Reference in New Issue
Block a user