Skip to main content

announce_std/
marker.rs

1//! announce mocks of `marker` traits (hand-written).
2
3#[allow(unused_imports)]
4use announce::announce;
5
6/// announce mock of [`::core::marker::Copy`]: invoke `Copy!` to receive its definition.
7///
8/// The real trait is available under the same path in the type namespace
9/// (from rustc 1.94, through a glob re-export, since the macro namespace holds this
10/// trampoline).
11#[announce(mock = ::core::marker::Copy)]
12pub trait Copy: ::core::clone::Clone {}
13
14#[cfg(announce_std_rust_1_94)]
15#[doc(hidden)]
16pub mod __real {
17    pub use ::core::marker::Copy;
18}
19#[cfg(announce_std_rust_1_94)]
20#[doc(no_inline)]
21pub use self::__real::*;
22
23#[cfg(not(announce_std_rust_1_94))]
24/// Fallback for rustc < 1.94: a blanket subtrait of [`::core::marker::Copy`], usable in bounds.
25pub trait Copy: ::core::marker::Copy {}
26#[cfg(not(announce_std_rust_1_94))]
27impl<__T: ?::core::marker::Sized + ::core::marker::Copy> Copy for __T {}