marker.rs 620 B

12345678910111213141516171819
  1. // SPDX-License-Identifier: Apache-2.0 OR MIT
  2. use alloc::rc::Rc;
  3. use core::marker::PhantomData;
  4. use core::panic::{RefUnwindSafe, UnwindSafe};
  5. // Zero sized marker with the correct set of autotrait impls we want all proc
  6. // macro types to have.
  7. #[derive(Copy, Clone)]
  8. #[cfg_attr(
  9. all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)),
  10. derive(PartialEq, Eq)
  11. )]
  12. pub(crate) struct ProcMacroAutoTraits(PhantomData<Rc<()>>);
  13. pub(crate) const MARKER: ProcMacroAutoTraits = ProcMacroAutoTraits(PhantomData);
  14. impl UnwindSafe for ProcMacroAutoTraits {}
  15. impl RefUnwindSafe for ProcMacroAutoTraits {}