Enum rustc_ast::tokenstream::Spacing
source · pub enum Spacing {
Alone,
Joint,
}
Expand description
Similar to proc_macro::Spacing
, but for tokens.
Note that all ast::TokenTree::Token
instances have a Spacing
, but when
we convert to proc_macro::TokenTree
for proc macros only Punct
TokenTree
s have a proc_macro::Spacing
.
Variants§
Alone
The token is not immediately followed by an operator token (as
determined by Token::is_op
). E.g. a +
token is Alone
in + =
,
+/*foo*/=
, +ident
, and +()
.
Joint
The token is immediately followed by an operator token. E.g. a +
token is Joint
in +=
and ++
.
Trait Implementations§
source§impl<__CTX> HashStable<__CTX> for Spacingwhere
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for Spacingwhere
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
impl Copy for Spacing
impl StructuralPartialEq for Spacing
Auto Trait Implementations§
impl RefUnwindSafe for Spacing
impl Send for Spacing
impl Sync for Spacing
impl Unpin for Spacing
impl UnwindSafe for Spacing
Blanket Implementations§
Layout§
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:
Alone
: 0 bytesJoint
: 0 bytes