parser: don't use unreachable!() in fn unexpected.
This commit is contained in:
parent
374ad1b006
commit
dcd91d5ceb
3 changed files with 33 additions and 1 deletions
|
|
@ -443,7 +443,9 @@ impl<'a> Parser<'a> {
|
|||
crate fn unexpected<T>(&mut self) -> PResult<'a, T> {
|
||||
match self.expect_one_of(&[], &[]) {
|
||||
Err(e) => Err(e),
|
||||
Ok(_) => unreachable!(),
|
||||
// We can get `Ok(true)` from `recover_closing_delimiter`
|
||||
// which is called in `expected_one_of_not_found`.
|
||||
Ok(_) => FatalError.raise(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue