From 4a1e57f13daef264ec7f6974354767332c8fb5df Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sat, 11 May 2024 13:17:30 -0700 Subject: [PATCH] Make ParseBuffer unwindsafe --- src/parse.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parse.rs b/src/parse.rs index 5d0fbc43b8..825ffc6cca 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -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; @@ -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`].