Struct marker_api::CtorBlocker
source · #[non_exhaustive]#[repr(C)]pub struct CtorBlocker { /* private fields */ }Expand description
This struct blocks the construction of enum variants, similar to the #[non_exhaustive]
attribute.
Marker uses enums extensively, like ItemKind and
ExprKind. There can be *Kind enums that wrap other
*Kind enums. In those cases, this struct is used, to block the user from
constructing the variant manually. This allows tools to handle the variants
confidently without additional verification. An example for this would be the
LitExprKind::UnaryOp variant.
This basically acts like a #[non_exhaustive] attribute, with the difference
that it also works on tuple variants. Attaching #[non_exhaustive] to a tuple
variant would make it private, which we don’t want.
As a normal user, you can just ignore this instance as it holds no relevant information for linting.
Trait Implementations§
source§impl Clone for CtorBlocker
impl Clone for CtorBlocker
source§fn clone(&self) -> CtorBlocker
fn clone(&self) -> CtorBlocker
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more