We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 928b3da + 826269e commit ac8316eCopy full SHA for ac8316e
compiler/rustc_parse/src/parser/mod.rs
@@ -504,18 +504,10 @@ impl<'a> Parser<'a> {
504
}
505
506
fn ident_or_err(&mut self, recover: bool) -> PResult<'a, (Ident, /* is_raw */ bool)> {
507
- let result = self.token.ident().ok_or_else(|| self.expected_ident_found(recover));
508
-
509
- let (ident, is_raw) = match result {
510
- Ok(ident) => ident,
511
- Err(err) => match err {
512
- // we recovered!
513
514
- Err(err) => return Err(err),
515
- },
516
- };
517
518
- Ok((ident, is_raw))
+ match self.token.ident() {
+ Some(ident) => Ok(ident),
+ None => self.expected_ident_found(recover),
+ }
519
520
521
/// Checks if the next token is `tok`, and returns `true` if so.
0 commit comments