pub enum Spacing {
Joint,
Alone,
}Expand description
Indicates whether a Punct token can join with the following token
to form a multi-character operator.
Variants§
Joint
A Punct token can join with the following token to form a multi-character operator.
In token streams constructed using proc macro interfaces, Joint punctuation tokens can be
followed by any other tokens. However, in token streams parsed from source code, the
compiler will only set spacing to Joint in the following cases.
- When a
Punctis immediately followed by anotherPunctwithout a whitespace. E.g.+isJointin+=and++. - When a single quote
'is immediately followed by an identifier without a whitespace. E.g.'isJointin'lifetime.
This list may be extended in the future to enable more token combinations.
Alone
A Punct token cannot join with the following token to form a multi-character operator.
Alone punctuation tokens can be followed by any other tokens. In token streams parsed
from source code, the compiler will set spacing to Alone in all cases not covered by the
conditions for Joint above. E.g. + is Alone in + =, +ident and +(). In
particular, tokens not followed by anything will be marked as Alone.
Trait Implementations§
impl Copy for Spacing
1.29.0 · Source§impl Eq for Spacing
impl Eq for Spacing
Source§#[doc(hidden)]fn assert_fields_are_eq(&self)
#[doc(hidden)]fn assert_fields_are_eq(&self)
derive_eq_internals)1.0.0 (const: unstable) · Source§#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
#[doc(hidden)]fn assert_receiver_is_total_eq(&self)
implementation detail of #[derive(Eq)]
impl StructuralPartialEq for Spacing
impl TrivialClone for Spacing
Auto Trait Implementations§
impl Freeze for Spacing
impl RefUnwindSafe for Spacing
impl Send for Spacing
impl Sync for Spacing
impl Unpin for Spacing
impl UnsafeUnpin for Spacing
impl UnwindSafe for Spacing
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Printable for T
Source§impl<T> SizeHint for Twhere
T: ?Sized,
impl<T> SizeHint for Twhere
T: ?Sized,
Source§default fn lower_bound(&self) -> usize
default fn lower_bound(&self) -> usize
core_io_internals)[u8; 12] could return any value between 0 and
12 inclusively as a correct implementation. Read moreSource§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)]const SIZE: usize = _
#[doc(hidden)]const SIZE: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGN: usize = _
#[doc(hidden)]const ALIGN: usize = _
sized_type_properties)Source§#[doc(hidden)]const ALIGNMENT: Alignment = _
#[doc(hidden)]const ALIGNMENT: Alignment = _
ptr_alignment_type #102070)Source§#[doc(hidden)]const IS_ZST: bool = _
#[doc(hidden)]const IS_ZST: bool = _
sized_type_properties)Source§#[doc(hidden)]const LAYOUT: Layout = _
#[doc(hidden)]const LAYOUT: Layout = _
sized_type_properties)Source§#[doc(hidden)]const MAX_SLICE_LEN: usize = _
#[doc(hidden)]const MAX_SLICE_LEN: usize = _
sized_type_properties)[Self]. Read more