assert-unmoved 0.1.7

A type that asserts that the underlying type is not moved after being pinned and mutably accessed.
Documentation
// SPDX-License-Identifier: Apache-2.0 OR MIT
// This file is @generated by assert-unmoved-internal-codegen
// (gen_assert_impl function at tools/codegen/src/main.rs).
// It is not intended for manual editing.

#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(
    dead_code,
    unused_macros,
    clippy::std_instead_of_alloc,
    clippy::std_instead_of_core,
)]
fn assert_send<T: ?Sized + Send>() {}
fn assert_sync<T: ?Sized + Sync>() {}
fn assert_unpin<T: ?Sized + Unpin>() {}
fn assert_unwind_safe<T: ?Sized + std::panic::UnwindSafe>() {}
fn assert_ref_unwind_safe<T: ?Sized + std::panic::RefUnwindSafe>() {}
/// `Send` & `!Sync`
struct NotSync(core::cell::UnsafeCell<()>);
/// `!Send` & `Sync`
struct NotSend(std::sync::MutexGuard<'static, ()>);
/// `!Send` & `!Sync`
struct NotSendSync(*const ());
/// `!Unpin`
struct NotUnpin(core::marker::PhantomPinned);
/// `!UnwindSafe`
struct NotUnwindSafe(&'static mut ());
/// `!RefUnwindSafe`
struct NotRefUnwindSafe(core::cell::UnsafeCell<()>);
macro_rules! assert_not_send {
    ($ty:ty) => {
        static_assertions::assert_not_impl_all!($ty : Send);
    };
}
macro_rules! assert_not_sync {
    ($ty:ty) => {
        static_assertions::assert_not_impl_all!($ty : Sync);
    };
}
macro_rules! assert_not_unpin {
    ($ty:ty) => {
        static_assertions::assert_not_impl_all!($ty : Unpin);
    };
}
macro_rules! assert_not_unwind_safe {
    ($ty:ty) => {
        static_assertions::assert_not_impl_all!($ty : std::panic::UnwindSafe);
    };
}
macro_rules! assert_not_ref_unwind_safe {
    ($ty:ty) => {
        static_assertions::assert_not_impl_all!($ty : std::panic::RefUnwindSafe);
    };
}
const _: fn() = || {
    assert_send::<crate::assert_unmoved::AssertUnmoved<()>>();
    assert_send::<crate::assert_unmoved::AssertUnmoved<NotSync>>();
    assert_not_send!(crate::assert_unmoved::AssertUnmoved<NotSend>);
    assert_sync::<crate::assert_unmoved::AssertUnmoved<()>>();
    assert_sync::<crate::assert_unmoved::AssertUnmoved<NotSend>>();
    assert_not_sync!(crate::assert_unmoved::AssertUnmoved<NotSync>);
    assert_not_unpin!(crate::assert_unmoved::AssertUnmoved<()>);
    assert_unwind_safe::<crate::assert_unmoved::AssertUnmoved<()>>();
    assert_not_unwind_safe!(crate::assert_unmoved::AssertUnmoved<NotUnwindSafe>);
    assert_ref_unwind_safe::<crate::assert_unmoved::AssertUnmoved<()>>();
    assert_not_ref_unwind_safe!(
        crate::assert_unmoved::AssertUnmoved<NotRefUnwindSafe>
    );
};