Skip to content

Commit

Permalink
Make ParseBuffer unwindsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 11, 2024
1 parent d29bf8e commit 4a1e57f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/parse.rs
Expand Up @@ -197,6 +197,7 @@ use std::hash::{Hash, Hasher};
use std::marker::PhantomData;
use std::mem;
use std::ops::Deref;
use std::panic::{RefUnwindSafe, UnwindSafe};
use std::rc::Rc;
use std::str::FromStr;

Expand Down Expand Up @@ -283,6 +284,9 @@ impl<'a> Debug for ParseBuffer<'a> {
}
}

impl<'a> UnwindSafe for ParseBuffer<'a> {}
impl<'a> RefUnwindSafe for ParseBuffer<'a> {}

/// Cursor state associated with speculative parsing.
///
/// This type is the input of the closure provided to [`ParseStream::step`].
Expand Down

0 comments on commit 4a1e57f

Please sign in to comment.