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, HirId, Span, Ident),
[src]
pub fn each_binding<F>(&self, f: F) where
F: FnMut(BindingAnnotation, HirId, Span, Ident),
🔬 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_ident(&self) -> Option<Ident>
[src]
pub fn simple_ident(&self) -> Option<Ident>
🔬 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
fn 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 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 Encodable for Pat
[src]
impl Encodable for Pat
fn 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 Pat
fn 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 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, 'tcx> HashStable<StableHashingContext<'a>> for Pat
[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Pat
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &mut StableHashingContext<'a>,
__hasher: &mut StableHasher<W>
)
[src]
fn hash_stable<W: StableHasherResult>(
&self,
__ctx: &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 HirNode for Pat
[src]
impl HirNode for Pat
fn hir_id(&self) -> HirId
[src]
fn hir_id(&self) -> 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?
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?