pub struct SubPattern {
pub tpe: Type,
pub pattern: TermPattern,
}Expand description
A pattern written in a position inside another one — a constructor’s argument, a tuple’s element or a record pattern’s entry — and the type of the value found there.
The position’s type travels with the pattern because a sub-pattern has no scrutinee
of its own to take one from: a variable written there binds a value of this type, and
any other pattern written there constrains this type the way a case branch’s
pattern constrains the scrutinee’s.
The pattern may be any TermPatternKind, itself holding sub-patterns to any depth:
typer::translate_pattern translates one written here as it does one at the top.
Fields§
§tpe: Type§pattern: TermPatternTrait Implementations§
Source§impl Clone for SubPattern
impl Clone for SubPattern
Source§fn clone(&self) -> SubPattern
fn clone(&self) -> SubPattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SubPattern
impl RefUnwindSafe for SubPattern
impl Send for SubPattern
impl Sync for SubPattern
impl Unpin for SubPattern
impl UnsafeUnpin for SubPattern
impl UnwindSafe for SubPattern
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