pub enum PatternKind<'tcx> {
Wild,
AscribeUserType {
user_ty: CanonicalTy<'tcx>,
subpattern: Pattern<'tcx>,
},
Binding {
mutability: Mutability,
name: Name,
mode: BindingMode<'tcx>,
var: NodeId,
ty: Ty<'tcx>,
subpattern: Option<Pattern<'tcx>>,
},
Variant {
adt_def: &'tcx AdtDef,
substs: &'tcx Substs<'tcx>,
variant_index: usize,
subpatterns: Vec<FieldPattern<'tcx>>,
},
Leaf {
subpatterns: Vec<FieldPattern<'tcx>>,
},
Deref {
subpattern: Pattern<'tcx>,
},
Constant {
value: &'tcx Const<'tcx>,
},
Range {
lo: &'tcx Const<'tcx>,
hi: &'tcx Const<'tcx>,
ty: Ty<'tcx>,
end: RangeEnd,
},
Slice {
prefix: Vec<Pattern<'tcx>>,
slice: Option<Pattern<'tcx>>,
suffix: Vec<Pattern<'tcx>>,
},
Array {
prefix: Vec<Pattern<'tcx>>,
slice: Option<Pattern<'tcx>>,
suffix: Vec<Pattern<'tcx>>,
},
}
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of AscribeUserType
user_ty: CanonicalTy<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
subpattern: Pattern<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of Binding
mutability: Mutability | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
name: Name | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
mode: BindingMode<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
var: NodeId | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
ty: Ty<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
subpattern: Option<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Foo(...) or Foo{...} or Foo, where Foo
is a variant name from an adt with >1 variants
Fields of Variant
adt_def: &'tcx AdtDef | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
substs: &'tcx Substs<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
variant_index: usize | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
subpatterns: Vec<FieldPattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
(...), Foo(...), Foo{...}, or Foo, where Foo
is a variant name from an adt with 1 variant
Fields of Leaf
subpatterns: Vec<FieldPattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of Deref
subpattern: Pattern<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of Constant
value: &'tcx Const<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields of Range
lo: &'tcx Const<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
hi: &'tcx Const<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
ty: Ty<'tcx> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
end: RangeEnd | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
matches against a slice, checking the length and extracting elements.
irrefutable when there is a slice pattern and both prefix
and suffix
are empty.
e.g. &[ref xs..]
.
Fields of Slice
prefix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
slice: Option<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
suffix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fixed match against an array, irrefutable
Fields of Array
prefix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
slice: Option<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
suffix: Vec<Pattern<'tcx>> | 🔬 This is a nightly-only experimental API. (rustc_private )this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?
|
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?