Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make sure Unpin is implemented for StackListener
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <dev@notgull.net>
notgull committed Dec 21, 2023
1 parent f658705 commit c7757f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1357,6 +1357,7 @@ pub mod __private {
pin_project_lite::pin_project! {
/// Space on the stack where a stack-based listener can be allocated.
#[doc(hidden)]
#[project(!Unpin)]
pub struct StackSlot<'ev, T> {
#[pin]
listener: InnerListener<T, &'ev Inner<T>>
@@ -1370,6 +1371,9 @@ pub mod __private {
}
}

impl<T> core::panic::UnwindSafe for StackSlot<'_, T> {}
impl<T> core::panic::RefUnwindSafe for StackSlot<'_, T> {}

impl<'ev, T> StackSlot<'ev, T> {
/// Create a new `StackSlot` on the stack.
#[inline]
@@ -1402,6 +1406,10 @@ pub mod __private {
slot: Pin<&'stack mut StackSlot<'ev, T>>,
}

impl<T> core::panic::UnwindSafe for StackListener<'_, '_, T> {}
impl<T> core::panic::RefUnwindSafe for StackListener<'_, '_, T> {}
impl<T> Unpin for StackListener<'_, '_, T> {}

impl<T> fmt::Debug for StackListener<'_, '_, T> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 comments on commit c7757f5

Please sign in to comment.