Enum rustc_parse::parser::expr::ForbiddenLetReason
source · pub(crate) enum ForbiddenLetReason {
OtherForbidden,
NotSupportedOr(Span),
NotSupportedParentheses(Span),
}
Expand description
Used to forbid let
expressions in certain syntactic locations.
Variants§
OtherForbidden
let
is not valid and the source environment is not important
NotSupportedOr(Span)
A let chain with the ||
operator
NotSupportedParentheses(Span)
A let chain with invalid parentheses
For example, let 1 = 1 && (expr && expr)
is allowed
but (let 1 = 1 && (let 1 = 1 && (let 1 = 1))) && let a = 1
is not
Trait Implementations§
source§impl Clone for ForbiddenLetReason
impl Clone for ForbiddenLetReason
source§fn clone(&self) -> ForbiddenLetReason
fn clone(&self) -> ForbiddenLetReason
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Subdiagnostic for ForbiddenLetReason
impl Subdiagnostic for ForbiddenLetReason
source§fn add_to_diag_with<__G, __F>(self, diag: &mut Diag<'_, __G>, f: __F)where
__G: EmissionGuarantee,
__F: SubdiagMessageOp<__G>,
fn add_to_diag_with<__G, __F>(self, diag: &mut Diag<'_, __G>, f: __F)where
__G: EmissionGuarantee,
__F: SubdiagMessageOp<__G>,
Add a subdiagnostic to an existing diagnostic where
f
is invoked on every message used
(to optionally perform eager translation).source§fn add_to_diag<G>(self, diag: &mut Diag<'_, G>)where
G: EmissionGuarantee,
fn add_to_diag<G>(self, diag: &mut Diag<'_, G>)where
G: EmissionGuarantee,
Add a subdiagnostic to an existing diagnostic.
impl Copy for ForbiddenLetReason
Auto Trait Implementations§
impl DynSend for ForbiddenLetReason
impl DynSync for ForbiddenLetReason
impl Freeze for ForbiddenLetReason
impl RefUnwindSafe for ForbiddenLetReason
impl Send for ForbiddenLetReason
impl Sync for ForbiddenLetReason
impl Unpin for ForbiddenLetReason
impl UnwindSafe for ForbiddenLetReason
Blanket Implementations§
source§impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
impl<'tcx, T> ArenaAllocatable<'tcx, IsCopy> for Twhere
T: Copy,
fn allocate_on<'a>(self, arena: &'a Arena<'tcx>) -> &'a mut T
fn allocate_from_iter<'a>( arena: &'a Arena<'tcx>, iter: impl IntoIterator<Item = T> ) -> &'a mut [T]
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
Mutably borrows from an owned value. Read more
source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§impl<T> Filterable for T
impl<T> Filterable for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
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: 12 bytes
Size for each variant:
OtherForbidden
: 0 bytesNotSupportedOr
: 8 bytesNotSupportedParentheses
: 8 bytes