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 Pat
pub 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, NodeId, Span, &Spanned<Name>),
[src]
pub fn each_binding<F>(&self, f: F) where
F: FnMut(BindingAnnotation, NodeId, 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 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 Pat
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 Pat
fn clone(&self) -> Pat
[src]
fn clone(&self) -> Pat
Returns 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 Pat
fn eq(&self, __arg_0: &Pat) -> bool
[src]
fn eq(&self, __arg_0: &Pat) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Pat) -> bool
[src]
fn ne(&self, __arg_0: &Pat) -> bool
This method tests for !=
.
impl Eq for Pat
[src]
impl Eq for Pat
impl Encodable for Pat
[src]
impl Encodable for Pat
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
[src]
fn encode<__S: Encoder>(&self, __arg_0: &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 Pat
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<Pat, __D::Error>
[src]
fn decode<__D: Decoder>(__arg_0: &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 Pat
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
fn hash<__H: Hasher>(&self, __arg_0: &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 Pat
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> HashStable<StableHashingContext<'a>> for Pat
[src]
impl<'a> HashStable<StableHashingContext<'a>> for Pat
fn 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 Pat
fn 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?