Struct rustc::hir::Pat [−][src]
🔬 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
id: 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?
hir_id: HirId
🔬 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?
node: PatKind
🔬 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?
span: Span
🔬 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?
Methods
impl Pat[src]
impl Patpub fn is_refutable(&self) -> bool[src]
pub fn is_refutable(&self) -> bool🔬 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?
pub fn is_const(&self) -> bool[src]
pub fn is_const(&self) -> bool🔬 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?
pub fn each_binding<F>(&self, f: F) where
F: FnMut(BindingAnnotation, HirId, Span, &Spanned<Name>), [src]
pub fn each_binding<F>(&self, f: F) where
F: FnMut(BindingAnnotation, HirId, Span, &Spanned<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?
Call f on every "binding" in a pattern, e.g., on a in
match foo() { Some(a) => (), None => () }
pub fn contains_bindings(&self) -> bool[src]
pub fn contains_bindings(&self) -> bool🔬 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?
Checks if the pattern contains any patterns that bind something to
an ident, e.g. foo, or Foo(foo) or foo @ Bar(..).
pub fn contains_bindings_or_wild(&self) -> bool[src]
pub fn contains_bindings_or_wild(&self) -> bool🔬 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?
Checks if the pattern contains any patterns that bind something to
an ident or wildcard, e.g. foo, or Foo(_), foo @ Bar(..),
pub fn simple_name(&self) -> Option<Name>[src]
pub fn simple_name(&self) -> Option<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?
pub fn simple_span(&self) -> Option<Span>[src]
pub fn simple_span(&self) -> Option<Span>🔬 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?
pub fn necessary_variants(&self) -> Vec<DefId>[src]
pub fn necessary_variants(&self) -> Vec<DefId>🔬 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?
Return variants that are necessary to exist for the pattern to match.
pub fn contains_explicit_ref_binding(&self) -> Option<Mutability>[src]
pub fn contains_explicit_ref_binding(&self) -> Option<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?
Checks if the pattern contains any ref or ref mut bindings, and if
yes whether it contains mutable or just immutables ones.
FIXME(tschottdorf): this is problematic as the HIR is being scraped, but ref bindings are be implicit after #42640 (default match binding modes).
See #44848.
impl Pat[src]
impl Patfn walk_<G>(&self, it: &mut G) -> bool where
G: FnMut(&Pat) -> bool, [src]
fn walk_<G>(&self, it: &mut G) -> bool where
G: FnMut(&Pat) -> bool, 🔬 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?
pub fn walk<F>(&self, it: F) -> bool where
F: FnMut(&Pat) -> bool, [src]
pub fn walk<F>(&self, it: F) -> bool where
F: FnMut(&Pat) -> bool, 🔬 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?
Trait Implementations
impl Clone for Pat[src]
impl Clone for Patfn clone(&self) -> Pat[src]
fn clone(&self) -> PatReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl PartialEq for Pat[src]
impl PartialEq for Patfn eq(&self, other: &Pat) -> bool[src]
fn eq(&self, other: &Pat) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Pat) -> bool[src]
fn ne(&self, other: &Pat) -> boolThis method tests for !=.
impl Eq for Pat[src]
impl Eq for Patfn assert_receiver_is_total_eq(&self)[src]
fn assert_receiver_is_total_eq(&self)impl Encodable for Pat[src]
impl Encodable for Patfn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>[src]
fn encode<__S: Encoder>(&self, s: &mut __S) -> Result<(), __S::Error>🔬 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?
impl Decodable for Pat[src]
impl Decodable for Patfn decode<__D: Decoder>(d: &mut __D) -> Result<Pat, __D::Error>[src]
fn decode<__D: Decoder>(d: &mut __D) -> Result<Pat, __D::Error>🔬 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?
impl Hash for Pat[src]
impl Hash for Patfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Debug for Pat[src]
impl Debug for Patfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl<'a> HashStable<StableHashingContext<'a>> for Pat[src]
impl<'a> HashStable<StableHashingContext<'a>> for Patfn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)[src]
fn hash_stable<W: StableHasherResult>(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>
)🔬 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?
impl ast_node for Pat[src]
impl ast_node for Patfn id(&self) -> NodeId[src]
fn id(&self) -> 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?
fn span(&self) -> Span[src]
fn span(&self) -> Span🔬 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?