mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35:22 +00:00
Hint that the unwrap should always succeed.
This commit is contained in:
parent
c8005694c7
commit
bff9884df1
1 changed files with 5 additions and 1 deletions
|
@ -1125,7 +1125,11 @@ where
|
|||
|
||||
fn eat_single_char(&mut self, ty: Tok) {
|
||||
let tok_start = self.get_pos();
|
||||
self.next_char();
|
||||
self.next_char().unwrap_or_else(|| unsafe {
|
||||
// SAFETY: eat_single_char has been called only after a character has been read
|
||||
// from the window, so the window is guaranteed to be non-empty.
|
||||
std::hint::unreachable_unchecked()
|
||||
});
|
||||
let tok_end = self.get_pos();
|
||||
self.emit((tok_start, ty, tok_end));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue