pub(crate) enum DeclOrigin<'a> {
LetExpr,
LocalDecl {
els: Option<&'a Block<'a>>,
},
}
Expand description
Provides context for checking patterns in declarations. More specifically this allows us to infer array types if the pattern is irrefutable and allows us to infer the size of the array. See issue #76342.
Variants§
Implementations§
source§impl<'a> DeclOrigin<'a>
impl<'a> DeclOrigin<'a>
pub(crate) fn try_get_else(&self) -> Option<&'a Block<'a>>
Trait Implementations§
source§impl<'a> Clone for DeclOrigin<'a>
impl<'a> Clone for DeclOrigin<'a>
source§fn clone(&self) -> DeclOrigin<'a>
fn clone(&self) -> DeclOrigin<'a>
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<'a> Debug for DeclOrigin<'a>
impl<'a> Debug for DeclOrigin<'a>
impl<'a> Copy for DeclOrigin<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for DeclOrigin<'a>
impl<'a> !Send for DeclOrigin<'a>
impl<'a> !Sync for DeclOrigin<'a>
impl<'a> Unpin for DeclOrigin<'a>
impl<'a> UnwindSafe for DeclOrigin<'a>
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
Mutably borrows from an owned value. Read more
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: 16 bytes
Size for each variant:
LetExpr
: 0 bytesLocalDecl
: 8 bytes