TraitObjectSyntax in rustc_ast::ast - Rust (original) (raw)
Enum TraitObjectSyntax
#[repr(u8)]
pub enum TraitObjectSyntax {
Dyn = 0,
DynStar = 1,
None = 2,
}
Expand description
Syntax used to declare a trait object.
Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient, and should not be overridden without very good reason.
SAFETY: TraitObjectSyntax
only has 3 data-less variants which means it can be represented with a u2
. We use repr(u8)
to guarantee the discriminants of the variants are no greater than 3
.
Number of least-significant bits in the return value of into_usizewhich may be non-zero. In other words this is the bit width of the value.
Turns this tag into an integer. Read more
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Dyn
: 0 bytesDynStar
: 0 bytesNone
: 0 bytes