Skip to main content

rustc_middle/
thir.rs

1//! THIR datatypes and definitions. See the [rustc dev guide] for more info.
2//!
3//! If you compare the THIR [`ExprKind`] to [`hir::ExprKind`], you will see it is
4//! a good bit simpler. In fact, a number of the more straight-forward
5//! MIR simplifications are already done in the lowering to THIR. For
6//! example, method calls and overloaded operators are absent: they are
7//! expected to be converted into [`ExprKind::Call`] instances.
8//!
9//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/thir.html
10
11use std::cmp::Ordering;
12use std::fmt;
13use std::ops::Index;
14use std::sync::Arc;
15
16use rustc_abi::{FieldIdx, Integer, Size, VariantIdx};
17use rustc_ast::{AsmMacro, InlineAsmOptions, InlineAsmTemplatePiece, Mutability};
18use rustc_attr_ir::UnrollAttr;
19use rustc_data_structures::fx::FxIndexMap;
20use rustc_data_structures::thin_vec::ThinVec;
21use rustc_hir as hir;
22use rustc_hir::def_id::DefId;
23use rustc_hir::{BindingMode, ByRef, HirId, MatchSource, RangeEnd};
24use rustc_index::{IndexVec, newtype_index};
25use rustc_macros::{StableHash, TyDecodable, TyEncodable, TypeVisitable};
26use rustc_span::def_id::LocalDefId;
27use rustc_span::{ErrorGuaranteed, Span, Symbol, bug};
28use rustc_target::asm::InlineAsmRegOrRegClass;
29use tracing::instrument;
30
31use crate::middle::region;
32use crate::mir::interpret::AllocId;
33use crate::mir::{self, AssignOp, BinOp, BorrowKind, FakeReadCause, UnOp};
34use crate::thir::visit::for_each_immediate_subpat;
35use crate::ty::adjustment::PointerCoercion;
36use crate::ty::layout::IntegerExt;
37use crate::ty::{
38    self, AdtDef, CanonicalUserType, CanonicalUserTypeAnnotation, FnSig, GenericArgs, Ty, TyCtxt,
39    UpvarArgs,
40};
41
42pub mod visit;
43
44macro_rules! thir_with_elements {
45    (
46        $($name:ident: $id:ty => $value:ty => $format:literal,)*
47    ) => {
48        $(
49            newtype_index! {
50                #[stable_hash]
51                #[debug_format = $format]
52                pub struct $id {}
53            }
54        )*
55
56        // Note: Making `Thir` implement `Clone` is useful for external tools that need access to
57        // THIR bodies even after the `Steal` query result has been stolen.
58        // One such tool is https://github.com/rust-corpus/qrates/.
59        /// A container for a THIR body.
60        ///
61        /// This can be indexed directly by any THIR index (e.g. [`ExprId`]).
62        #[derive(Debug, StableHash, Clone)]
63        pub struct Thir<'tcx> {
64            pub body_type: BodyTy<'tcx>,
65            pub loop_hint_attrs: FxIndexMap<ExprId, ThinVec<UnrollAttr>>,
66            $(
67                pub $name: IndexVec<$id, $value>,
68            )*
69        }
70
71        impl<'tcx> Thir<'tcx> {
72            pub fn new(body_type: BodyTy<'tcx>) -> Thir<'tcx> {
73                Thir {
74                    body_type,
75                    loop_hint_attrs: FxIndexMap::default(),
76                    $(
77                        $name: IndexVec::new(),
78                    )*
79                }
80            }
81        }
82
83        $(
84            impl<'tcx> Index<$id> for Thir<'tcx> {
85                type Output = $value;
86                fn index(&self, index: $id) -> &Self::Output {
87                    &self.$name[index]
88                }
89            }
90        )*
91    }
92}
93
94impl ::std::fmt::Debug for ParamId {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        fmt.write_fmt(format_args!("p{0}", self.as_u32()))
    }
}
/// A container for a THIR body.
///
/// This can be indexed directly by any THIR index (e.g. [`ExprId`]).
pub struct Thir<'tcx> {
    pub body_type: BodyTy<'tcx>,
    pub loop_hint_attrs: FxIndexMap<ExprId, ThinVec<UnrollAttr>>,
    pub arms: IndexVec<ArmId, Arm<'tcx>>,
    pub blocks: IndexVec<BlockId, Block>,
    pub exprs: IndexVec<ExprId, Expr<'tcx>>,
    pub stmts: IndexVec<StmtId, Stmt<'tcx>>,
    pub params: IndexVec<ParamId, Param<'tcx>>,
}
#[automatically_derived]impl<'tcx> ::core::fmt::Debug for Thir<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_fields_finish(f,
            "Thir body_type loop_hint_attrs arms blocks exprs stmts params",
            &[&self.body_type, &self.loop_hint_attrs, &self.arms,
                        &self.blocks, &self.exprs, &self.stmts, &&self.params])
    }
}
const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Thir<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Thir {
                        body_type: ref __binding_0,
                        loop_hint_attrs: ref __binding_1,
                        arms: ref __binding_2,
                        blocks: ref __binding_3,
                        exprs: ref __binding_4,
                        stmts: ref __binding_5,
                        params: ref __binding_6 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                        { __binding_6.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };
#[automatically_derived]impl<'tcx> ::core::clone::Clone for Thir<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Thir {
            body_type: ::core::clone::Clone::clone(&self.body_type),
            loop_hint_attrs: ::core::clone::Clone::clone(&self.loop_hint_attrs),
            arms: ::core::clone::Clone::clone(&self.arms),
            blocks: ::core::clone::Clone::clone(&self.blocks),
            exprs: ::core::clone::Clone::clone(&self.exprs),
            stmts: ::core::clone::Clone::clone(&self.stmts),
            params: ::core::clone::Clone::clone(&self.params),
        }
    }
}
impl<'tcx> Thir<'tcx> {
    pub fn new(body_type: BodyTy<'tcx>) -> Thir<'tcx> {
        Thir {
            body_type,
            loop_hint_attrs: FxIndexMap::default(),
            arms: IndexVec::new(),
            blocks: IndexVec::new(),
            exprs: IndexVec::new(),
            stmts: IndexVec::new(),
            params: IndexVec::new(),
        }
    }
}
impl<'tcx> Index<ArmId> for Thir<'tcx> {
    type Output = Arm<'tcx>;
    fn index(&self, index: ArmId) -> &Self::Output { &self.arms[index] }
}
impl<'tcx> Index<BlockId> for Thir<'tcx> {
    type Output = Block;
    fn index(&self, index: BlockId) -> &Self::Output { &self.blocks[index] }
}
impl<'tcx> Index<ExprId> for Thir<'tcx> {
    type Output = Expr<'tcx>;
    fn index(&self, index: ExprId) -> &Self::Output { &self.exprs[index] }
}
impl<'tcx> Index<StmtId> for Thir<'tcx> {
    type Output = Stmt<'tcx>;
    fn index(&self, index: StmtId) -> &Self::Output { &self.stmts[index] }
}
impl<'tcx> Index<ParamId> for Thir<'tcx> {
    type Output = Param<'tcx>;
    fn index(&self, index: ParamId) -> &Self::Output { &self.params[index] }
}thir_with_elements! {
95    arms: ArmId => Arm<'tcx> => "a{}",
96    blocks: BlockId => Block => "b{}",
97    exprs: ExprId => Expr<'tcx> => "e{}",
98    stmts: StmtId => Stmt<'tcx> => "s{}",
99    params: ParamId => Param<'tcx> => "p{}",
100}
101
102#[derive(#[automatically_derived]impl<'tcx> ::core::fmt::Debug for BodyTy<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Const(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Const",
                    &__self_0),
            Self::Fn(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Fn",
                    &__self_0),
            Self::GlobalAsm(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "GlobalAsm", &__self_0),
        }
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            BodyTy<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    BodyTy::Const(ref __binding_0) =>
                        0u8.stable_hash(__hcx, __hasher),
                    BodyTy::Fn(ref __binding_0) =>
                        1u8.stable_hash(__hcx, __hasher),
                    BodyTy::GlobalAsm(ref __binding_0) =>
                        2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    BodyTy::Const(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    BodyTy::Fn(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    BodyTy::GlobalAsm(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, #[automatically_derived]impl<'tcx> ::core::clone::Clone for BodyTy<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        match self {
            Self::Const(__self_0) =>
                BodyTy::Const(::core::clone::Clone::clone(__self_0)),
            Self::Fn(__self_0) =>
                BodyTy::Fn(::core::clone::Clone::clone(__self_0)),
            Self::GlobalAsm(__self_0) =>
                BodyTy::GlobalAsm(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone)]
103pub enum BodyTy<'tcx> {
104    Const(Ty<'tcx>),
105    Fn(FnSig<'tcx>),
106    GlobalAsm(Ty<'tcx>),
107}
108
109/// Description of a type-checked function parameter.
110#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for Param<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Param {
            pat: ::core::clone::Clone::clone(&self.pat),
            ty: ::core::clone::Clone::clone(&self.ty),
            ty_span: ::core::clone::Clone::clone(&self.ty_span),
            self_kind: ::core::clone::Clone::clone(&self.self_kind),
            hir_id: ::core::clone::Clone::clone(&self.hir_id),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for Param<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field5_finish(f,
            "Param pat ty ty_span self_kind hir_id", &self.pat, &self.ty,
            &self.ty_span, &self.self_kind, &&self.hir_id)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Param<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Param {
                        pat: ref __binding_0,
                        ty: ref __binding_1,
                        ty_span: ref __binding_2,
                        self_kind: ref __binding_3,
                        hir_id: ref __binding_4 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
111pub struct Param<'tcx> {
112    /// The pattern that appears in the parameter list, or None for implicit parameters.
113    pub pat: Option<Box<Pat<'tcx>>>,
114    /// The possibly inferred type.
115    pub ty: Ty<'tcx>,
116    /// Span of the explicitly provided type, or None if inferred for closures.
117    pub ty_span: Option<Span>,
118    /// Whether this param is `self`, and how it is bound.
119    pub self_kind: Option<hir::ImplicitSelfKind>,
120    /// HirId for lints.
121    pub hir_id: Option<HirId>,
122}
123
124#[derive(#[automatically_derived]impl ::core::clone::Clone for Block {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Block {
            targeted_by_break: ::core::clone::Clone::clone(&self.targeted_by_break),
            region_scope: ::core::clone::Clone::clone(&self.region_scope),
            span: ::core::clone::Clone::clone(&self.span),
            stmts: ::core::clone::Clone::clone(&self.stmts),
            expr: ::core::clone::Clone::clone(&self.expr),
            safety_mode: ::core::clone::Clone::clone(&self.safety_mode),
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for Block {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_fields_finish(f,
            "Block targeted_by_break region_scope span stmts expr safety_mode",
            &[&self.targeted_by_break, &self.region_scope, &self.span,
                        &self.stmts, &self.expr, &&self.safety_mode])
    }
}Debug, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for Block {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Block {
                        targeted_by_break: ref __binding_0,
                        region_scope: ref __binding_1,
                        span: ref __binding_2,
                        stmts: ref __binding_3,
                        expr: ref __binding_4,
                        safety_mode: ref __binding_5 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
125pub struct Block {
126    /// Whether the block itself has a label. Used by `label: {}`
127    /// and `try` blocks.
128    ///
129    /// This does *not* include labels on loops, e.g. `'label: loop {}`.
130    pub targeted_by_break: bool,
131    pub region_scope: region::Scope,
132    /// The span of the block, including the opening braces,
133    /// the label, and the `unsafe` keyword, if present.
134    pub span: Span,
135    /// The statements in the blocK.
136    pub stmts: Box<[StmtId]>,
137    /// The trailing expression of the block, if any.
138    pub expr: Option<ExprId>,
139    pub safety_mode: BlockSafety,
140}
141
142type UserTy<'tcx> = Option<Box<CanonicalUserType<'tcx>>>;
143
144#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for AdtExpr<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        AdtExpr {
            adt_def: ::core::clone::Clone::clone(&self.adt_def),
            variant_index: ::core::clone::Clone::clone(&self.variant_index),
            args: ::core::clone::Clone::clone(&self.args),
            user_ty: ::core::clone::Clone::clone(&self.user_ty),
            fields: ::core::clone::Clone::clone(&self.fields),
            base: ::core::clone::Clone::clone(&self.base),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for AdtExpr<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_fields_finish(f,
            "AdtExpr adt_def variant_index args user_ty fields base",
            &[&self.adt_def, &self.variant_index, &self.args, &self.user_ty,
                        &self.fields, &&self.base])
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            AdtExpr<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    AdtExpr {
                        adt_def: ref __binding_0,
                        variant_index: ref __binding_1,
                        args: ref __binding_2,
                        user_ty: ref __binding_3,
                        fields: ref __binding_4,
                        base: ref __binding_5 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
145pub struct AdtExpr<'tcx> {
146    /// The ADT we're constructing.
147    pub adt_def: AdtDef<'tcx>,
148    /// The variant of the ADT.
149    pub variant_index: VariantIdx,
150    pub args: GenericArgs<'tcx>,
151
152    /// Optional user-given args: for something like `let x =
153    /// Bar::<T> { ... }`.
154    pub user_ty: UserTy<'tcx>,
155
156    pub fields: Box<[FieldExpr]>,
157    /// The base, e.g. `Foo {x: 1, ..base}`.
158    pub base: AdtExprBase<'tcx>,
159}
160
161#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for AdtExprBase<'tcx>
    {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        match self {
            Self::None => AdtExprBase::None,
            Self::Base(__self_0) =>
                AdtExprBase::Base(::core::clone::Clone::clone(__self_0)),
            Self::DefaultFields(__self_0) =>
                AdtExprBase::DefaultFields(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for AdtExprBase<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::None => ::core::fmt::Formatter::write_str(f, "None"),
            Self::Base(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Base",
                    &__self_0),
            Self::DefaultFields(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "DefaultFields", &__self_0),
        }
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            AdtExprBase<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    AdtExprBase::None => 0u8.stable_hash(__hcx, __hasher),
                    AdtExprBase::Base(ref __binding_0) =>
                        1u8.stable_hash(__hcx, __hasher),
                    AdtExprBase::DefaultFields(ref __binding_0) =>
                        2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    AdtExprBase::None => {}
                    AdtExprBase::Base(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    AdtExprBase::DefaultFields(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
162pub enum AdtExprBase<'tcx> {
163    /// A struct expression where all the fields are explicitly enumerated: `Foo { a, b }`.
164    None,
165    /// A struct expression with a "base", an expression of the same type as the outer struct that
166    /// will be used to populate any fields not explicitly mentioned: `Foo { ..base }`
167    Base(FruInfo<'tcx>),
168    /// A struct expression with a `..` tail but no "base" expression. The values from the struct
169    /// fields' default values will be used to populate any fields not explicitly mentioned:
170    /// `Foo { .. }`.
171    DefaultFields(Box<[Ty<'tcx>]>),
172}
173
174#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for ClosureExpr<'tcx>
    {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        ClosureExpr {
            closure_id: ::core::clone::Clone::clone(&self.closure_id),
            args: ::core::clone::Clone::clone(&self.args),
            upvars: ::core::clone::Clone::clone(&self.upvars),
            movability: ::core::clone::Clone::clone(&self.movability),
            fake_reads: ::core::clone::Clone::clone(&self.fake_reads),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for ClosureExpr<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field5_finish(f,
            "ClosureExpr closure_id args upvars movability fake_reads",
            &self.closure_id, &self.args, &self.upvars, &self.movability,
            &&self.fake_reads)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ClosureExpr<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ClosureExpr {
                        closure_id: ref __binding_0,
                        args: ref __binding_1,
                        upvars: ref __binding_2,
                        movability: ref __binding_3,
                        fake_reads: ref __binding_4 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
175pub struct ClosureExpr<'tcx> {
176    pub closure_id: LocalDefId,
177    pub args: UpvarArgs<'tcx>,
178    pub upvars: Box<[ExprId]>,
179    pub movability: Option<hir::Movability>,
180    pub fake_reads: Vec<(ExprId, FakeReadCause, HirId)>,
181}
182
183#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    InlineAsmExpr<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        InlineAsmExpr {
            asm_macro: ::core::clone::Clone::clone(&self.asm_macro),
            template: ::core::clone::Clone::clone(&self.template),
            operands: ::core::clone::Clone::clone(&self.operands),
            options: ::core::clone::Clone::clone(&self.options),
            line_spans: ::core::clone::Clone::clone(&self.line_spans),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for InlineAsmExpr<'tcx>
    {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field5_finish(f,
            "InlineAsmExpr asm_macro template operands options line_spans",
            &self.asm_macro, &self.template, &self.operands, &self.options,
            &&self.line_spans)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            InlineAsmExpr<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    InlineAsmExpr {
                        asm_macro: ref __binding_0,
                        template: ref __binding_1,
                        operands: ref __binding_2,
                        options: ref __binding_3,
                        line_spans: ref __binding_4 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
184pub struct InlineAsmExpr<'tcx> {
185    pub asm_macro: AsmMacro,
186    pub template: &'tcx [InlineAsmTemplatePiece],
187    pub operands: Box<[InlineAsmOperand<'tcx>]>,
188    pub options: InlineAsmOptions,
189    pub line_spans: &'tcx [Span],
190}
191
192#[derive(#[automatically_derived]impl ::core::marker::Copy for BlockSafety { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for BlockSafety {
}
#[automatically_derived]impl ::core::clone::Clone for BlockSafety {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<HirId>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for BlockSafety {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Safe => ::core::fmt::Formatter::write_str(f, "Safe"),
            Self::BuiltinUnsafe =>
                ::core::fmt::Formatter::write_str(f, "BuiltinUnsafe"),
            Self::ExplicitUnsafe(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ExplicitUnsafe", &__self_0),
        }
    }
}Debug, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for BlockSafety
            {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    BlockSafety::Safe => 0u8.stable_hash(__hcx, __hasher),
                    BlockSafety::BuiltinUnsafe =>
                        1u8.stable_hash(__hcx, __hasher),
                    BlockSafety::ExplicitUnsafe(ref __binding_0) =>
                        2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    BlockSafety::Safe => {}
                    BlockSafety::BuiltinUnsafe => {}
                    BlockSafety::ExplicitUnsafe(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
193pub enum BlockSafety {
194    Safe,
195    /// A compiler-generated unsafe block
196    BuiltinUnsafe,
197    /// An `unsafe` block. The `HirId` is the ID of the block.
198    ExplicitUnsafe(HirId),
199}
200
201#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for Stmt<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Stmt { kind: ::core::clone::Clone::clone(&self.kind) }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for Stmt<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f, "Stmt kind",
            &&self.kind)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Stmt<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Stmt { kind: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
202pub struct Stmt<'tcx> {
203    pub kind: StmtKind<'tcx>,
204}
205
206#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for StmtKind<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        match self {
            Self::Expr { scope: __self_0, expr: __self_1 } =>
                StmtKind::Expr {
                    scope: ::core::clone::Clone::clone(__self_0),
                    expr: ::core::clone::Clone::clone(__self_1),
                },
            Self::Let {
                remainder_scope: __self_0,
                init_scope: __self_1,
                pattern: __self_2,
                initializer: __self_3,
                else_block: __self_4,
                hir_id: __self_5,
                span: __self_6 } =>
                StmtKind::Let {
                    remainder_scope: ::core::clone::Clone::clone(__self_0),
                    init_scope: ::core::clone::Clone::clone(__self_1),
                    pattern: ::core::clone::Clone::clone(__self_2),
                    initializer: ::core::clone::Clone::clone(__self_3),
                    else_block: ::core::clone::Clone::clone(__self_4),
                    hir_id: ::core::clone::Clone::clone(__self_5),
                    span: ::core::clone::Clone::clone(__self_6),
                },
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for StmtKind<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Expr { scope: __self_0, expr: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Expr scope expr", __self_0, &__self_1),
            Self::Let {
                remainder_scope: __self_0,
                init_scope: __self_1,
                pattern: __self_2,
                initializer: __self_3,
                else_block: __self_4,
                hir_id: __self_5,
                span: __self_6 } =>
                ::core::fmt::Formatter::debug_struct_fields_finish(f,
                    "Let remainder_scope init_scope pattern initializer else_block hir_id span",
                    &[__self_0, __self_1, __self_2, __self_3, __self_4,
                                __self_5, &__self_6]),
        }
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            StmtKind<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    StmtKind::Expr {
                        scope: ref __binding_0, expr: ref __binding_1 } =>
                        0u8.stable_hash(__hcx, __hasher),
                    StmtKind::Let {
                        remainder_scope: ref __binding_0,
                        init_scope: ref __binding_1,
                        pattern: ref __binding_2,
                        initializer: ref __binding_3,
                        else_block: ref __binding_4,
                        hir_id: ref __binding_5,
                        span: ref __binding_6 } => 1u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    StmtKind::Expr {
                        scope: ref __binding_0, expr: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    StmtKind::Let {
                        remainder_scope: ref __binding_0,
                        init_scope: ref __binding_1,
                        pattern: ref __binding_2,
                        initializer: ref __binding_3,
                        else_block: ref __binding_4,
                        hir_id: ref __binding_5,
                        span: ref __binding_6 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                        { __binding_6.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
207pub enum StmtKind<'tcx> {
208    /// An expression with a trailing semicolon.
209    Expr {
210        /// The scope for this statement; may be used as lifetime of temporaries.
211        scope: region::Scope,
212
213        /// The expression being evaluated in this statement.
214        expr: ExprId,
215    },
216
217    /// A `let` binding.
218    Let {
219        /// The scope for variables bound in this `let`; it covers this and
220        /// all the remaining statements in the block.
221        remainder_scope: region::Scope,
222
223        /// The scope for the initialization itself; might be used as
224        /// lifetime of temporaries.
225        init_scope: region::Scope,
226
227        /// `let <PAT> = ...`
228        ///
229        /// If a type annotation is included, it is added as an ascription pattern.
230        pattern: Box<Pat<'tcx>>,
231
232        /// `let pat: ty = <INIT>`
233        initializer: Option<ExprId>,
234
235        /// `let pat: ty = <INIT> else { <ELSE> }`
236        else_block: Option<BlockId>,
237
238        /// The [`HirId`] for this `let` statement.
239        hir_id: HirId,
240
241        /// Span of the `let <PAT> = <INIT>` part.
242        span: Span,
243    },
244}
245
246#[derive(#[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for LocalVarId {
}
#[automatically_derived]impl ::core::clone::Clone for LocalVarId {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<HirId>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for LocalVarId {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f, "LocalVarId",
            &&self.0)
    }
}Debug, #[automatically_derived]impl ::core::marker::Copy for LocalVarId { }Copy, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    LocalVarId {
}
#[automatically_derived]impl ::core::cmp::PartialEq for LocalVarId {
    #[inline]
    fn eq(&self, other: &Self) -> bool { self.0 == other.0 }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for LocalVarId {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<HirId>;
    }
}Eq, #[automatically_derived]impl ::core::hash::Hash for LocalVarId {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.0, state)
    }
}Hash, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for LocalVarId {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    LocalVarId(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for LocalVarId {
            fn encode(&self, __encoder: &mut __E) {
                let LocalVarId(ref __binding_0) = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for LocalVarId {
            fn decode(__decoder: &mut __D) -> Self {
                LocalVarId(::rustc_serialize::Decodable::decode(__decoder))
            }
        }
    };TyDecodable)]
247pub struct LocalVarId(pub HirId);
248
249/// A THIR expression.
250#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for Expr<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Expr {
            kind: ::core::clone::Clone::clone(&self.kind),
            ty: ::core::clone::Clone::clone(&self.ty),
            temp_scope_id: ::core::clone::Clone::clone(&self.temp_scope_id),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for Expr<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "Expr kind ty temp_scope_id span", &self.kind, &self.ty,
            &self.temp_scope_id, &&self.span)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Expr<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Expr {
                        kind: ref __binding_0,
                        ty: ref __binding_1,
                        temp_scope_id: ref __binding_2,
                        span: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
251pub struct Expr<'tcx> {
252    /// kind of expression
253    pub kind: ExprKind<'tcx>,
254
255    /// The type of this expression
256    pub ty: Ty<'tcx>,
257
258    /// The id of the HIR expression whose [temporary scope] should be used for this expression.
259    ///
260    /// Also used by coverage instrumentation to recover the HIR node that corresponds to a THIR
261    /// expression node.
262    ///
263    /// [temporary scope]: https://doc.rust-lang.org/reference/destructors.html#temporary-scopes
264    pub temp_scope_id: hir::ItemLocalId,
265
266    /// span of the expression in the source
267    pub span: Span,
268}
269
270#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for ExprKind<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        match self {
            Self::Scope {
                region_scope: __self_0, hir_id: __self_1, value: __self_2 } =>
                ExprKind::Scope {
                    region_scope: ::core::clone::Clone::clone(__self_0),
                    hir_id: ::core::clone::Clone::clone(__self_1),
                    value: ::core::clone::Clone::clone(__self_2),
                },
            Self::If {
                if_then_scope: __self_0,
                cond: __self_1,
                then: __self_2,
                else_opt: __self_3 } =>
                ExprKind::If {
                    if_then_scope: ::core::clone::Clone::clone(__self_0),
                    cond: ::core::clone::Clone::clone(__self_1),
                    then: ::core::clone::Clone::clone(__self_2),
                    else_opt: ::core::clone::Clone::clone(__self_3),
                },
            Self::Call {
                ty: __self_0,
                fun: __self_1,
                args: __self_2,
                from_hir_call: __self_3,
                fn_span: __self_4 } =>
                ExprKind::Call {
                    ty: ::core::clone::Clone::clone(__self_0),
                    fun: ::core::clone::Clone::clone(__self_1),
                    args: ::core::clone::Clone::clone(__self_2),
                    from_hir_call: ::core::clone::Clone::clone(__self_3),
                    fn_span: ::core::clone::Clone::clone(__self_4),
                },
            Self::ByUse { expr: __self_0, span: __self_1 } =>
                ExprKind::ByUse {
                    expr: ::core::clone::Clone::clone(__self_0),
                    span: ::core::clone::Clone::clone(__self_1),
                },
            Self::Deref { arg: __self_0 } =>
                ExprKind::Deref {
                    arg: ::core::clone::Clone::clone(__self_0),
                },
            Self::Binary { op: __self_0, lhs: __self_1, rhs: __self_2 } =>
                ExprKind::Binary {
                    op: ::core::clone::Clone::clone(__self_0),
                    lhs: ::core::clone::Clone::clone(__self_1),
                    rhs: ::core::clone::Clone::clone(__self_2),
                },
            Self::LogicalOp { op: __self_0, lhs: __self_1, rhs: __self_2 } =>
                ExprKind::LogicalOp {
                    op: ::core::clone::Clone::clone(__self_0),
                    lhs: ::core::clone::Clone::clone(__self_1),
                    rhs: ::core::clone::Clone::clone(__self_2),
                },
            Self::Unary { op: __self_0, arg: __self_1 } =>
                ExprKind::Unary {
                    op: ::core::clone::Clone::clone(__self_0),
                    arg: ::core::clone::Clone::clone(__self_1),
                },
            Self::Cast { source: __self_0 } =>
                ExprKind::Cast {
                    source: ::core::clone::Clone::clone(__self_0),
                },
            Self::ValueExpr { source: __self_0 } =>
                ExprKind::ValueExpr {
                    source: ::core::clone::Clone::clone(__self_0),
                },
            Self::NeverToAny { source: __self_0 } =>
                ExprKind::NeverToAny {
                    source: ::core::clone::Clone::clone(__self_0),
                },
            Self::PointerCoercion {
                cast: __self_0, source: __self_1, is_from_as_cast: __self_2 }
                =>
                ExprKind::PointerCoercion {
                    cast: ::core::clone::Clone::clone(__self_0),
                    source: ::core::clone::Clone::clone(__self_1),
                    is_from_as_cast: ::core::clone::Clone::clone(__self_2),
                },
            Self::Loop { body: __self_0 } =>
                ExprKind::Loop {
                    body: ::core::clone::Clone::clone(__self_0),
                },
            Self::LoopMatch {
                state: __self_0, region_scope: __self_1, match_data: __self_2
                } =>
                ExprKind::LoopMatch {
                    state: ::core::clone::Clone::clone(__self_0),
                    region_scope: ::core::clone::Clone::clone(__self_1),
                    match_data: ::core::clone::Clone::clone(__self_2),
                },
            Self::Let { expr: __self_0, pat: __self_1 } =>
                ExprKind::Let {
                    expr: ::core::clone::Clone::clone(__self_0),
                    pat: ::core::clone::Clone::clone(__self_1),
                },
            Self::Match {
                scrutinee: __self_0, arms: __self_1, match_source: __self_2 }
                =>
                ExprKind::Match {
                    scrutinee: ::core::clone::Clone::clone(__self_0),
                    arms: ::core::clone::Clone::clone(__self_1),
                    match_source: ::core::clone::Clone::clone(__self_2),
                },
            Self::Block { block: __self_0 } =>
                ExprKind::Block {
                    block: ::core::clone::Clone::clone(__self_0),
                },
            Self::Assign { lhs: __self_0, rhs: __self_1 } =>
                ExprKind::Assign {
                    lhs: ::core::clone::Clone::clone(__self_0),
                    rhs: ::core::clone::Clone::clone(__self_1),
                },
            Self::AssignOp { op: __self_0, lhs: __self_1, rhs: __self_2 } =>
                ExprKind::AssignOp {
                    op: ::core::clone::Clone::clone(__self_0),
                    lhs: ::core::clone::Clone::clone(__self_1),
                    rhs: ::core::clone::Clone::clone(__self_2),
                },
            Self::Field {
                lhs: __self_0, variant_index: __self_1, name: __self_2 } =>
                ExprKind::Field {
                    lhs: ::core::clone::Clone::clone(__self_0),
                    variant_index: ::core::clone::Clone::clone(__self_1),
                    name: ::core::clone::Clone::clone(__self_2),
                },
            Self::Index { lhs: __self_0, index: __self_1 } =>
                ExprKind::Index {
                    lhs: ::core::clone::Clone::clone(__self_0),
                    index: ::core::clone::Clone::clone(__self_1),
                },
            Self::VarRef { id: __self_0 } =>
                ExprKind::VarRef {
                    id: ::core::clone::Clone::clone(__self_0),
                },
            Self::UpvarRef { closure_def_id: __self_0, var_hir_id: __self_1 }
                =>
                ExprKind::UpvarRef {
                    closure_def_id: ::core::clone::Clone::clone(__self_0),
                    var_hir_id: ::core::clone::Clone::clone(__self_1),
                },
            Self::Borrow { borrow_kind: __self_0, arg: __self_1 } =>
                ExprKind::Borrow {
                    borrow_kind: ::core::clone::Clone::clone(__self_0),
                    arg: ::core::clone::Clone::clone(__self_1),
                },
            Self::RawBorrow { mutability: __self_0, arg: __self_1 } =>
                ExprKind::RawBorrow {
                    mutability: ::core::clone::Clone::clone(__self_0),
                    arg: ::core::clone::Clone::clone(__self_1),
                },
            Self::Break { label: __self_0, value: __self_1 } =>
                ExprKind::Break {
                    label: ::core::clone::Clone::clone(__self_0),
                    value: ::core::clone::Clone::clone(__self_1),
                },
            Self::Continue { label: __self_0 } =>
                ExprKind::Continue {
                    label: ::core::clone::Clone::clone(__self_0),
                },
            Self::ConstContinue { label: __self_0, value: __self_1 } =>
                ExprKind::ConstContinue {
                    label: ::core::clone::Clone::clone(__self_0),
                    value: ::core::clone::Clone::clone(__self_1),
                },
            Self::Return { value: __self_0 } =>
                ExprKind::Return {
                    value: ::core::clone::Clone::clone(__self_0),
                },
            Self::Become { value: __self_0 } =>
                ExprKind::Become {
                    value: ::core::clone::Clone::clone(__self_0),
                },
            Self::ConstBlock { did: __self_0, args: __self_1 } =>
                ExprKind::ConstBlock {
                    did: ::core::clone::Clone::clone(__self_0),
                    args: ::core::clone::Clone::clone(__self_1),
                },
            Self::Repeat { value: __self_0, count: __self_1 } =>
                ExprKind::Repeat {
                    value: ::core::clone::Clone::clone(__self_0),
                    count: ::core::clone::Clone::clone(__self_1),
                },
            Self::Array { fields: __self_0 } =>
                ExprKind::Array {
                    fields: ::core::clone::Clone::clone(__self_0),
                },
            Self::Tuple { fields: __self_0 } =>
                ExprKind::Tuple {
                    fields: ::core::clone::Clone::clone(__self_0),
                },
            Self::Adt(__self_0) =>
                ExprKind::Adt(::core::clone::Clone::clone(__self_0)),
            Self::PlaceTypeAscription {
                source: __self_0, user_ty: __self_1, user_ty_span: __self_2 }
                =>
                ExprKind::PlaceTypeAscription {
                    source: ::core::clone::Clone::clone(__self_0),
                    user_ty: ::core::clone::Clone::clone(__self_1),
                    user_ty_span: ::core::clone::Clone::clone(__self_2),
                },
            Self::ValueTypeAscription {
                source: __self_0, user_ty: __self_1, user_ty_span: __self_2 }
                =>
                ExprKind::ValueTypeAscription {
                    source: ::core::clone::Clone::clone(__self_0),
                    user_ty: ::core::clone::Clone::clone(__self_1),
                    user_ty_span: ::core::clone::Clone::clone(__self_2),
                },
            Self::PlaceUnwrapUnsafeBinder { source: __self_0 } =>
                ExprKind::PlaceUnwrapUnsafeBinder {
                    source: ::core::clone::Clone::clone(__self_0),
                },
            Self::ValueUnwrapUnsafeBinder { source: __self_0 } =>
                ExprKind::ValueUnwrapUnsafeBinder {
                    source: ::core::clone::Clone::clone(__self_0),
                },
            Self::WrapUnsafeBinder { source: __self_0 } =>
                ExprKind::WrapUnsafeBinder {
                    source: ::core::clone::Clone::clone(__self_0),
                },
            Self::Closure(__self_0) =>
                ExprKind::Closure(::core::clone::Clone::clone(__self_0)),
            Self::Literal { lit: __self_0, neg: __self_1 } =>
                ExprKind::Literal {
                    lit: ::core::clone::Clone::clone(__self_0),
                    neg: ::core::clone::Clone::clone(__self_1),
                },
            Self::NonHirLiteral { lit: __self_0, user_ty: __self_1 } =>
                ExprKind::NonHirLiteral {
                    lit: ::core::clone::Clone::clone(__self_0),
                    user_ty: ::core::clone::Clone::clone(__self_1),
                },
            Self::ZstLiteral { user_ty: __self_0 } =>
                ExprKind::ZstLiteral {
                    user_ty: ::core::clone::Clone::clone(__self_0),
                },
            Self::NamedConst {
                def_id: __self_0, args: __self_1, user_ty: __self_2 } =>
                ExprKind::NamedConst {
                    def_id: ::core::clone::Clone::clone(__self_0),
                    args: ::core::clone::Clone::clone(__self_1),
                    user_ty: ::core::clone::Clone::clone(__self_2),
                },
            Self::ConstParam { param: __self_0, def_id: __self_1 } =>
                ExprKind::ConstParam {
                    param: ::core::clone::Clone::clone(__self_0),
                    def_id: ::core::clone::Clone::clone(__self_1),
                },
            Self::StaticRef {
                alloc_id: __self_0, ty: __self_1, def_id: __self_2 } =>
                ExprKind::StaticRef {
                    alloc_id: ::core::clone::Clone::clone(__self_0),
                    ty: ::core::clone::Clone::clone(__self_1),
                    def_id: ::core::clone::Clone::clone(__self_2),
                },
            Self::InlineAsm(__self_0) =>
                ExprKind::InlineAsm(::core::clone::Clone::clone(__self_0)),
            Self::ThreadLocalRef(__self_0) =>
                ExprKind::ThreadLocalRef(::core::clone::Clone::clone(__self_0)),
            Self::Yield { value: __self_0 } =>
                ExprKind::Yield {
                    value: ::core::clone::Clone::clone(__self_0),
                },
            Self::Reborrow {
                source: __self_0, mutability: __self_1, target: __self_2 } =>
                ExprKind::Reborrow {
                    source: ::core::clone::Clone::clone(__self_0),
                    mutability: ::core::clone::Clone::clone(__self_1),
                    target: ::core::clone::Clone::clone(__self_2),
                },
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for ExprKind<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Scope {
                region_scope: __self_0, hir_id: __self_1, value: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Scope region_scope hir_id value", __self_0, __self_1,
                    &__self_2),
            Self::If {
                if_then_scope: __self_0,
                cond: __self_1,
                then: __self_2,
                else_opt: __self_3 } =>
                ::core::fmt::Formatter::debug_struct_field4_finish(f,
                    "If if_then_scope cond then else_opt", __self_0, __self_1,
                    __self_2, &__self_3),
            Self::Call {
                ty: __self_0,
                fun: __self_1,
                args: __self_2,
                from_hir_call: __self_3,
                fn_span: __self_4 } =>
                ::core::fmt::Formatter::debug_struct_field5_finish(f,
                    "Call ty fun args from_hir_call fn_span", __self_0,
                    __self_1, __self_2, __self_3, &__self_4),
            Self::ByUse { expr: __self_0, span: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "ByUse expr span", __self_0, &__self_1),
            Self::Deref { arg: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Deref arg", &__self_0),
            Self::Binary { op: __self_0, lhs: __self_1, rhs: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Binary op lhs rhs", __self_0, __self_1, &__self_2),
            Self::LogicalOp { op: __self_0, lhs: __self_1, rhs: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "LogicalOp op lhs rhs", __self_0, __self_1, &__self_2),
            Self::Unary { op: __self_0, arg: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Unary op arg", __self_0, &__self_1),
            Self::Cast { source: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Cast source", &__self_0),
            Self::ValueExpr { source: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ValueExpr source", &__self_0),
            Self::NeverToAny { source: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "NeverToAny source", &__self_0),
            Self::PointerCoercion {
                cast: __self_0, source: __self_1, is_from_as_cast: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "PointerCoercion cast source is_from_as_cast", __self_0,
                    __self_1, &__self_2),
            Self::Loop { body: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Loop body", &__self_0),
            Self::LoopMatch {
                state: __self_0, region_scope: __self_1, match_data: __self_2
                } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "LoopMatch state region_scope match_data", __self_0,
                    __self_1, &__self_2),
            Self::Let { expr: __self_0, pat: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Let expr pat", __self_0, &__self_1),
            Self::Match {
                scrutinee: __self_0, arms: __self_1, match_source: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Match scrutinee arms match_source", __self_0, __self_1,
                    &__self_2),
            Self::Block { block: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Block block", &__self_0),
            Self::Assign { lhs: __self_0, rhs: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Assign lhs rhs", __self_0, &__self_1),
            Self::AssignOp { op: __self_0, lhs: __self_1, rhs: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "AssignOp op lhs rhs", __self_0, __self_1, &__self_2),
            Self::Field {
                lhs: __self_0, variant_index: __self_1, name: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Field lhs variant_index name", __self_0, __self_1,
                    &__self_2),
            Self::Index { lhs: __self_0, index: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Index lhs index", __self_0, &__self_1),
            Self::VarRef { id: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "VarRef id", &__self_0),
            Self::UpvarRef { closure_def_id: __self_0, var_hir_id: __self_1 }
                =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "UpvarRef closure_def_id var_hir_id", __self_0, &__self_1),
            Self::Borrow { borrow_kind: __self_0, arg: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Borrow borrow_kind arg", __self_0, &__self_1),
            Self::RawBorrow { mutability: __self_0, arg: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "RawBorrow mutability arg", __self_0, &__self_1),
            Self::Break { label: __self_0, value: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Break label value", __self_0, &__self_1),
            Self::Continue { label: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Continue label", &__self_0),
            Self::ConstContinue { label: __self_0, value: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "ConstContinue label value", __self_0, &__self_1),
            Self::Return { value: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Return value", &__self_0),
            Self::Become { value: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Become value", &__self_0),
            Self::ConstBlock { did: __self_0, args: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "ConstBlock did args", __self_0, &__self_1),
            Self::Repeat { value: __self_0, count: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Repeat value count", __self_0, &__self_1),
            Self::Array { fields: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Array fields", &__self_0),
            Self::Tuple { fields: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Tuple fields", &__self_0),
            Self::Adt(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Adt",
                    &__self_0),
            Self::PlaceTypeAscription {
                source: __self_0, user_ty: __self_1, user_ty_span: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "PlaceTypeAscription source user_ty user_ty_span", __self_0,
                    __self_1, &__self_2),
            Self::ValueTypeAscription {
                source: __self_0, user_ty: __self_1, user_ty_span: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "ValueTypeAscription source user_ty user_ty_span", __self_0,
                    __self_1, &__self_2),
            Self::PlaceUnwrapUnsafeBinder { source: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "PlaceUnwrapUnsafeBinder source", &__self_0),
            Self::ValueUnwrapUnsafeBinder { source: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ValueUnwrapUnsafeBinder source", &__self_0),
            Self::WrapUnsafeBinder { source: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "WrapUnsafeBinder source", &__self_0),
            Self::Closure(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Closure", &__self_0),
            Self::Literal { lit: __self_0, neg: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Literal lit neg", __self_0, &__self_1),
            Self::NonHirLiteral { lit: __self_0, user_ty: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "NonHirLiteral lit user_ty", __self_0, &__self_1),
            Self::ZstLiteral { user_ty: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ZstLiteral user_ty", &__self_0),
            Self::NamedConst {
                def_id: __self_0, args: __self_1, user_ty: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "NamedConst def_id args user_ty", __self_0, __self_1,
                    &__self_2),
            Self::ConstParam { param: __self_0, def_id: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "ConstParam param def_id", __self_0, &__self_1),
            Self::StaticRef {
                alloc_id: __self_0, ty: __self_1, def_id: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "StaticRef alloc_id ty def_id", __self_0, __self_1,
                    &__self_2),
            Self::InlineAsm(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "InlineAsm", &__self_0),
            Self::ThreadLocalRef(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ThreadLocalRef", &__self_0),
            Self::Yield { value: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Yield value", &__self_0),
            Self::Reborrow {
                source: __self_0, mutability: __self_1, target: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Reborrow source mutability target", __self_0, __self_1,
                    &__self_2),
        }
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ExprKind<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ExprKind::Scope {
                        region_scope: ref __binding_0,
                        hir_id: ref __binding_1,
                        value: ref __binding_2 } =>
                        0u8.stable_hash(__hcx, __hasher),
                    ExprKind::If {
                        if_then_scope: ref __binding_0,
                        cond: ref __binding_1,
                        then: ref __binding_2,
                        else_opt: ref __binding_3 } =>
                        1u8.stable_hash(__hcx, __hasher),
                    ExprKind::Call {
                        ty: ref __binding_0,
                        fun: ref __binding_1,
                        args: ref __binding_2,
                        from_hir_call: ref __binding_3,
                        fn_span: ref __binding_4 } =>
                        2u8.stable_hash(__hcx, __hasher),
                    ExprKind::ByUse {
                        expr: ref __binding_0, span: ref __binding_1 } =>
                        3u8.stable_hash(__hcx, __hasher),
                    ExprKind::Deref { arg: ref __binding_0 } =>
                        4u8.stable_hash(__hcx, __hasher),
                    ExprKind::Binary {
                        op: ref __binding_0,
                        lhs: ref __binding_1,
                        rhs: ref __binding_2 } => 5u8.stable_hash(__hcx, __hasher),
                    ExprKind::LogicalOp {
                        op: ref __binding_0,
                        lhs: ref __binding_1,
                        rhs: ref __binding_2 } => 6u8.stable_hash(__hcx, __hasher),
                    ExprKind::Unary { op: ref __binding_0, arg: ref __binding_1
                        } => 7u8.stable_hash(__hcx, __hasher),
                    ExprKind::Cast { source: ref __binding_0 } =>
                        8u8.stable_hash(__hcx, __hasher),
                    ExprKind::ValueExpr { source: ref __binding_0 } =>
                        9u8.stable_hash(__hcx, __hasher),
                    ExprKind::NeverToAny { source: ref __binding_0 } =>
                        10u8.stable_hash(__hcx, __hasher),
                    ExprKind::PointerCoercion {
                        cast: ref __binding_0,
                        source: ref __binding_1,
                        is_from_as_cast: ref __binding_2 } =>
                        11u8.stable_hash(__hcx, __hasher),
                    ExprKind::Loop { body: ref __binding_0 } =>
                        12u8.stable_hash(__hcx, __hasher),
                    ExprKind::LoopMatch {
                        state: ref __binding_0,
                        region_scope: ref __binding_1,
                        match_data: ref __binding_2 } =>
                        13u8.stable_hash(__hcx, __hasher),
                    ExprKind::Let { expr: ref __binding_0, pat: ref __binding_1
                        } => 14u8.stable_hash(__hcx, __hasher),
                    ExprKind::Match {
                        scrutinee: ref __binding_0,
                        arms: ref __binding_1,
                        match_source: ref __binding_2 } =>
                        15u8.stable_hash(__hcx, __hasher),
                    ExprKind::Block { block: ref __binding_0 } =>
                        16u8.stable_hash(__hcx, __hasher),
                    ExprKind::Assign {
                        lhs: ref __binding_0, rhs: ref __binding_1 } =>
                        17u8.stable_hash(__hcx, __hasher),
                    ExprKind::AssignOp {
                        op: ref __binding_0,
                        lhs: ref __binding_1,
                        rhs: ref __binding_2 } => 18u8.stable_hash(__hcx, __hasher),
                    ExprKind::Field {
                        lhs: ref __binding_0,
                        variant_index: ref __binding_1,
                        name: ref __binding_2 } =>
                        19u8.stable_hash(__hcx, __hasher),
                    ExprKind::Index {
                        lhs: ref __binding_0, index: ref __binding_1 } =>
                        20u8.stable_hash(__hcx, __hasher),
                    ExprKind::VarRef { id: ref __binding_0 } =>
                        21u8.stable_hash(__hcx, __hasher),
                    ExprKind::UpvarRef {
                        closure_def_id: ref __binding_0, var_hir_id: ref __binding_1
                        } => 22u8.stable_hash(__hcx, __hasher),
                    ExprKind::Borrow {
                        borrow_kind: ref __binding_0, arg: ref __binding_1 } =>
                        23u8.stable_hash(__hcx, __hasher),
                    ExprKind::RawBorrow {
                        mutability: ref __binding_0, arg: ref __binding_1 } =>
                        24u8.stable_hash(__hcx, __hasher),
                    ExprKind::Break {
                        label: ref __binding_0, value: ref __binding_1 } =>
                        25u8.stable_hash(__hcx, __hasher),
                    ExprKind::Continue { label: ref __binding_0 } =>
                        26u8.stable_hash(__hcx, __hasher),
                    ExprKind::ConstContinue {
                        label: ref __binding_0, value: ref __binding_1 } =>
                        27u8.stable_hash(__hcx, __hasher),
                    ExprKind::Return { value: ref __binding_0 } =>
                        28u8.stable_hash(__hcx, __hasher),
                    ExprKind::Become { value: ref __binding_0 } =>
                        29u8.stable_hash(__hcx, __hasher),
                    ExprKind::ConstBlock {
                        did: ref __binding_0, args: ref __binding_1 } =>
                        30u8.stable_hash(__hcx, __hasher),
                    ExprKind::Repeat {
                        value: ref __binding_0, count: ref __binding_1 } =>
                        31u8.stable_hash(__hcx, __hasher),
                    ExprKind::Array { fields: ref __binding_0 } =>
                        32u8.stable_hash(__hcx, __hasher),
                    ExprKind::Tuple { fields: ref __binding_0 } =>
                        33u8.stable_hash(__hcx, __hasher),
                    ExprKind::Adt(ref __binding_0) =>
                        34u8.stable_hash(__hcx, __hasher),
                    ExprKind::PlaceTypeAscription {
                        source: ref __binding_0,
                        user_ty: ref __binding_1,
                        user_ty_span: ref __binding_2 } =>
                        35u8.stable_hash(__hcx, __hasher),
                    ExprKind::ValueTypeAscription {
                        source: ref __binding_0,
                        user_ty: ref __binding_1,
                        user_ty_span: ref __binding_2 } =>
                        36u8.stable_hash(__hcx, __hasher),
                    ExprKind::PlaceUnwrapUnsafeBinder { source: ref __binding_0
                        } => 37u8.stable_hash(__hcx, __hasher),
                    ExprKind::ValueUnwrapUnsafeBinder { source: ref __binding_0
                        } => 38u8.stable_hash(__hcx, __hasher),
                    ExprKind::WrapUnsafeBinder { source: ref __binding_0 } =>
                        39u8.stable_hash(__hcx, __hasher),
                    ExprKind::Closure(ref __binding_0) =>
                        40u8.stable_hash(__hcx, __hasher),
                    ExprKind::Literal {
                        lit: ref __binding_0, neg: ref __binding_1 } =>
                        41u8.stable_hash(__hcx, __hasher),
                    ExprKind::NonHirLiteral {
                        lit: ref __binding_0, user_ty: ref __binding_1 } =>
                        42u8.stable_hash(__hcx, __hasher),
                    ExprKind::ZstLiteral { user_ty: ref __binding_0 } =>
                        43u8.stable_hash(__hcx, __hasher),
                    ExprKind::NamedConst {
                        def_id: ref __binding_0,
                        args: ref __binding_1,
                        user_ty: ref __binding_2 } =>
                        44u8.stable_hash(__hcx, __hasher),
                    ExprKind::ConstParam {
                        param: ref __binding_0, def_id: ref __binding_1 } =>
                        45u8.stable_hash(__hcx, __hasher),
                    ExprKind::StaticRef {
                        alloc_id: ref __binding_0,
                        ty: ref __binding_1,
                        def_id: ref __binding_2 } =>
                        46u8.stable_hash(__hcx, __hasher),
                    ExprKind::InlineAsm(ref __binding_0) =>
                        47u8.stable_hash(__hcx, __hasher),
                    ExprKind::ThreadLocalRef(ref __binding_0) =>
                        48u8.stable_hash(__hcx, __hasher),
                    ExprKind::Yield { value: ref __binding_0 } =>
                        49u8.stable_hash(__hcx, __hasher),
                    ExprKind::Reborrow {
                        source: ref __binding_0,
                        mutability: ref __binding_1,
                        target: ref __binding_2 } =>
                        50u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    ExprKind::Scope {
                        region_scope: ref __binding_0,
                        hir_id: ref __binding_1,
                        value: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::If {
                        if_then_scope: ref __binding_0,
                        cond: ref __binding_1,
                        then: ref __binding_2,
                        else_opt: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Call {
                        ty: ref __binding_0,
                        fun: ref __binding_1,
                        args: ref __binding_2,
                        from_hir_call: ref __binding_3,
                        fn_span: ref __binding_4 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ByUse {
                        expr: ref __binding_0, span: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Deref { arg: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Binary {
                        op: ref __binding_0,
                        lhs: ref __binding_1,
                        rhs: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::LogicalOp {
                        op: ref __binding_0,
                        lhs: ref __binding_1,
                        rhs: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Unary { op: ref __binding_0, arg: ref __binding_1
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Cast { source: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ValueExpr { source: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::NeverToAny { source: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::PointerCoercion {
                        cast: ref __binding_0,
                        source: ref __binding_1,
                        is_from_as_cast: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Loop { body: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::LoopMatch {
                        state: ref __binding_0,
                        region_scope: ref __binding_1,
                        match_data: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Let { expr: ref __binding_0, pat: ref __binding_1
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Match {
                        scrutinee: ref __binding_0,
                        arms: ref __binding_1,
                        match_source: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Block { block: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Assign {
                        lhs: ref __binding_0, rhs: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::AssignOp {
                        op: ref __binding_0,
                        lhs: ref __binding_1,
                        rhs: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Field {
                        lhs: ref __binding_0,
                        variant_index: ref __binding_1,
                        name: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Index {
                        lhs: ref __binding_0, index: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::VarRef { id: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::UpvarRef {
                        closure_def_id: ref __binding_0, var_hir_id: ref __binding_1
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Borrow {
                        borrow_kind: ref __binding_0, arg: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::RawBorrow {
                        mutability: ref __binding_0, arg: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Break {
                        label: ref __binding_0, value: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Continue { label: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ConstContinue {
                        label: ref __binding_0, value: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Return { value: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Become { value: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ConstBlock {
                        did: ref __binding_0, args: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Repeat {
                        value: ref __binding_0, count: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Array { fields: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Tuple { fields: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Adt(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::PlaceTypeAscription {
                        source: ref __binding_0,
                        user_ty: ref __binding_1,
                        user_ty_span: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ValueTypeAscription {
                        source: ref __binding_0,
                        user_ty: ref __binding_1,
                        user_ty_span: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::PlaceUnwrapUnsafeBinder { source: ref __binding_0
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ValueUnwrapUnsafeBinder { source: ref __binding_0
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::WrapUnsafeBinder { source: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Closure(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Literal {
                        lit: ref __binding_0, neg: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::NonHirLiteral {
                        lit: ref __binding_0, user_ty: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ZstLiteral { user_ty: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::NamedConst {
                        def_id: ref __binding_0,
                        args: ref __binding_1,
                        user_ty: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ConstParam {
                        param: ref __binding_0, def_id: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::StaticRef {
                        alloc_id: ref __binding_0,
                        ty: ref __binding_1,
                        def_id: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::InlineAsm(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::ThreadLocalRef(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Yield { value: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ExprKind::Reborrow {
                        source: ref __binding_0,
                        mutability: ref __binding_1,
                        target: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
271pub enum ExprKind<'tcx> {
272    /// `Scope`s are used to explicitly mark destruction scopes,
273    /// and to track the `HirId` of the expressions within the scope.
274    Scope {
275        region_scope: region::Scope,
276        hir_id: HirId,
277        value: ExprId,
278    },
279    /// An `if` expression.
280    If {
281        if_then_scope: region::Scope,
282        cond: ExprId,
283        /// `then` is always `ExprKind::Block`.
284        then: ExprId,
285        /// If present, the `else_opt` expr is always `ExprKind::Block` (for
286        /// `else`) or `ExprKind::If` (for `else if`).
287        else_opt: Option<ExprId>,
288    },
289    /// A function call. Method calls and overloaded operators are converted to plain function calls.
290    Call {
291        /// The type of the function. This is often a [`FnDef`] or a [`FnPtr`].
292        ///
293        /// [`FnDef`]: ty::TyKind::FnDef
294        /// [`FnPtr`]: ty::TyKind::FnPtr
295        ty: Ty<'tcx>,
296        /// The function itself.
297        fun: ExprId,
298        /// The arguments passed to the function.
299        ///
300        /// Note: in some cases (like calling a closure), the function call `f(...args)` gets
301        /// rewritten as a call to a function trait method (e.g. `FnOnce::call_once(f, (...args))`).
302        args: Box<[ExprId]>,
303        /// Whether this is from an overloaded operator rather than a
304        /// function call from HIR. `true` for overloaded function call.
305        from_hir_call: bool,
306        /// The span of the function, without the dot and receiver
307        /// (e.g. `foo(a, b)` in `x.foo(a, b)`).
308        fn_span: Span,
309    },
310    /// A use expression `x.use`.
311    ByUse {
312        /// The expression on which use is applied.
313        expr: ExprId,
314        /// The span of use, without the dot and receiver
315        /// (e.g. `use` in `x.use`).
316        span: Span,
317    },
318    /// A *non-overloaded* dereference.
319    Deref {
320        arg: ExprId,
321    },
322    /// A *non-overloaded* binary operation.
323    Binary {
324        op: BinOp,
325        lhs: ExprId,
326        rhs: ExprId,
327    },
328    /// A logical operation. This is distinct from `BinaryOp` because
329    /// the operands need to be lazily evaluated.
330    LogicalOp {
331        op: LogicalOp,
332        lhs: ExprId,
333        rhs: ExprId,
334    },
335    /// A *non-overloaded* unary operation. Note that here the deref (`*`)
336    /// operator is represented by `ExprKind::Deref`.
337    Unary {
338        op: UnOp,
339        arg: ExprId,
340    },
341    /// A cast: `<source> as <type>`. The type we cast to is the type of
342    /// the parent expression.
343    Cast {
344        source: ExprId,
345    },
346    /// Forces its contents to be treated as a value expression, not a place
347    /// expression. This is inserted in some places where an operation would
348    /// otherwise be erased completely (e.g. some no-op casts), but we still
349    /// need to ensure that its operand is treated as a value and not a place.
350    ValueExpr {
351        source: ExprId,
352    },
353    /// A coercion from `!` to any type.
354    NeverToAny {
355        source: ExprId,
356    },
357    /// A pointer coercion. More information can be found in [`PointerCoercion`].
358    /// Pointer casts that cannot be done by coercions are represented by [`ExprKind::Cast`].
359    PointerCoercion {
360        cast: PointerCoercion,
361        source: ExprId,
362        /// Whether this coercion is written with an `as` cast in the source code.
363        is_from_as_cast: bool,
364    },
365    /// A `loop` expression.
366    Loop {
367        body: ExprId,
368    },
369    /// A `#[loop_match] loop { state = 'blk: { match state { ... } } }` expression.
370    LoopMatch {
371        /// The state variable that is updated.
372        /// The `match_data.scrutinee` is the same variable, but with a different span.
373        state: ExprId,
374        region_scope: region::Scope,
375        match_data: Box<LoopMatchMatchData>,
376    },
377    /// Special expression representing the `let` part of an `if let` or similar construct
378    /// (including `if let` guards in match arms, and let-chains formed by `&&`).
379    ///
380    /// This isn't considered a real expression in surface Rust syntax, so it can
381    /// only appear in specific situations, such as within the condition of an `if`.
382    ///
383    /// (Not to be confused with [`StmtKind::Let`], which is a normal `let` statement.)
384    Let {
385        expr: ExprId,
386        pat: Box<Pat<'tcx>>,
387    },
388    /// A `match` expression.
389    Match {
390        scrutinee: ExprId,
391        arms: Box<[ArmId]>,
392        match_source: MatchSource,
393    },
394    /// A block.
395    Block {
396        block: BlockId,
397    },
398    /// An assignment: `lhs = rhs`.
399    Assign {
400        lhs: ExprId,
401        rhs: ExprId,
402    },
403    /// A *non-overloaded* operation assignment, e.g. `lhs += rhs`.
404    AssignOp {
405        op: AssignOp,
406        lhs: ExprId,
407        rhs: ExprId,
408    },
409    /// Access to a field of a struct, a tuple, an union, or an enum.
410    Field {
411        lhs: ExprId,
412        /// Variant containing the field.
413        variant_index: VariantIdx,
414        /// This can be a named (`.foo`) or unnamed (`.0`) field.
415        name: FieldIdx,
416    },
417    /// A *non-overloaded* indexing operation.
418    Index {
419        lhs: ExprId,
420        index: ExprId,
421    },
422    /// A local variable.
423    VarRef {
424        id: LocalVarId,
425    },
426    /// Used to represent upvars mentioned in a closure/coroutine
427    UpvarRef {
428        /// DefId of the closure/coroutine
429        closure_def_id: DefId,
430
431        /// HirId of the root variable
432        var_hir_id: LocalVarId,
433    },
434    /// A borrow, e.g. `&arg`.
435    Borrow {
436        borrow_kind: BorrowKind,
437        arg: ExprId,
438    },
439    /// A `&raw [const|mut] $place_expr` raw borrow resulting in type `*[const|mut] T`.
440    RawBorrow {
441        mutability: hir::Mutability,
442        arg: ExprId,
443    },
444    /// A `break` expression.
445    Break {
446        label: region::Scope,
447        value: Option<ExprId>,
448    },
449    /// A `continue` expression.
450    Continue {
451        label: region::Scope,
452    },
453    /// A `#[const_continue] break` expression.
454    ConstContinue {
455        label: region::Scope,
456        value: ExprId,
457    },
458    /// A `return` expression.
459    Return {
460        value: Option<ExprId>,
461    },
462    /// A `become` expression.
463    Become {
464        value: ExprId,
465    },
466    /// An inline `const` block, e.g. `const {}`.
467    ConstBlock {
468        did: DefId,
469        args: GenericArgs<'tcx>,
470    },
471    /// An array literal constructed from one repeated element, e.g. `[1; 5]`.
472    Repeat {
473        value: ExprId,
474        count: ty::Const<'tcx>,
475    },
476    /// An array, e.g. `[a, b, c, d]`.
477    Array {
478        fields: Box<[ExprId]>,
479    },
480    /// A tuple, e.g. `(a, b, c, d)`.
481    Tuple {
482        fields: Box<[ExprId]>,
483    },
484    /// An ADT constructor, e.g. `Foo {x: 1, y: 2}`.
485    Adt(Box<AdtExpr<'tcx>>),
486    /// A type ascription on a place.
487    PlaceTypeAscription {
488        source: ExprId,
489        /// Type that the user gave to this expression
490        user_ty: UserTy<'tcx>,
491        user_ty_span: Span,
492    },
493    /// A type ascription on a value, e.g. `type_ascribe!(42, i32)` or `42 as i32`.
494    ValueTypeAscription {
495        source: ExprId,
496        /// Type that the user gave to this expression
497        user_ty: UserTy<'tcx>,
498        user_ty_span: Span,
499    },
500    /// An unsafe binder cast on a place, e.g. `unwrap_binder!(*ptr)`.
501    PlaceUnwrapUnsafeBinder {
502        source: ExprId,
503    },
504    /// An unsafe binder cast on a value, e.g. `unwrap_binder!(rvalue())`,
505    /// which makes a temporary.
506    ValueUnwrapUnsafeBinder {
507        source: ExprId,
508    },
509    /// Construct an unsafe binder, e.g. `wrap_binder(&ref)`.
510    WrapUnsafeBinder {
511        source: ExprId,
512    },
513    /// A closure definition.
514    Closure(Box<ClosureExpr<'tcx>>),
515    /// A literal.
516    Literal {
517        lit: hir::Lit,
518        neg: bool,
519    },
520    /// For literals that don't correspond to anything in the HIR
521    NonHirLiteral {
522        lit: ty::ScalarInt,
523        user_ty: UserTy<'tcx>,
524    },
525    /// A literal of a ZST type.
526    ZstLiteral {
527        user_ty: UserTy<'tcx>,
528    },
529    /// Associated constants and named constants
530    NamedConst {
531        def_id: DefId,
532        args: GenericArgs<'tcx>,
533        user_ty: UserTy<'tcx>,
534    },
535    ConstParam {
536        param: ty::ParamConst,
537        def_id: DefId,
538    },
539    // FIXME improve docs for `StaticRef` by distinguishing it from `NamedConst`
540    /// A literal containing the address of a `static`.
541    ///
542    /// This is only distinguished from `Literal` so that we can register some
543    /// info for diagnostics.
544    StaticRef {
545        alloc_id: AllocId,
546        ty: Ty<'tcx>,
547        def_id: DefId,
548    },
549    /// Inline assembly, i.e. `asm!()`.
550    InlineAsm(Box<InlineAsmExpr<'tcx>>),
551    /// An expression taking a reference to a thread local.
552    ThreadLocalRef(DefId),
553    /// A `yield` expression.
554    Yield {
555        value: ExprId,
556    },
557    /// Use of an ADT that implements the Reborrow (for Mut) or CoerceShared traits (for Not). This
558    /// expression is produced by the [`Adjust::GenericReborrow`] in places where normally the ADT
559    /// would be moved or assigned over. Instead, this produces an [`Rvalue::Reborrow`] which
560    /// produces a bitwise copy of the source ADT and disables the source for the copy's lifetime.
561    ///
562    /// [`Adjust::GenericReborrow`]: crate::ty::adjustment::Adjust::GenericReborrow
563    /// [`Rvalue::Reborrow`]: mir::Rvalue::Reborrow
564    Reborrow {
565        source: ExprId,
566        mutability: Mutability,
567        target: Ty<'tcx>,
568    },
569}
570
571/// Represents the association of a field identifier and an expression.
572///
573/// This is used in struct constructors.
574#[derive(#[automatically_derived]impl ::core::clone::Clone for FieldExpr {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        FieldExpr {
            name: ::core::clone::Clone::clone(&self.name),
            expr: ::core::clone::Clone::clone(&self.expr),
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for FieldExpr {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "FieldExpr name expr", &self.name, &&self.expr)
    }
}Debug, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for FieldExpr {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    FieldExpr { name: ref __binding_0, expr: ref __binding_1 }
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
575pub struct FieldExpr {
576    pub name: FieldIdx,
577    pub expr: ExprId,
578}
579
580#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for FruInfo<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        FruInfo {
            base: ::core::clone::Clone::clone(&self.base),
            field_types: ::core::clone::Clone::clone(&self.field_types),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for FruInfo<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "FruInfo base field_types", &self.base, &&self.field_types)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            FruInfo<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    FruInfo {
                        base: ref __binding_0, field_types: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
581pub struct FruInfo<'tcx> {
582    pub base: ExprId,
583    pub field_types: Box<[Ty<'tcx>]>,
584}
585
586/// A `match` arm.
587#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for Arm<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Arm {
            pattern: ::core::clone::Clone::clone(&self.pattern),
            guard: ::core::clone::Clone::clone(&self.guard),
            body: ::core::clone::Clone::clone(&self.body),
            hir_id: ::core::clone::Clone::clone(&self.hir_id),
            scope: ::core::clone::Clone::clone(&self.scope),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for Arm<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_fields_finish(f,
            "Arm pattern guard body hir_id scope span",
            &[&self.pattern, &self.guard, &self.body, &self.hir_id,
                        &self.scope, &&self.span])
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Arm<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Arm {
                        pattern: ref __binding_0,
                        guard: ref __binding_1,
                        body: ref __binding_2,
                        hir_id: ref __binding_3,
                        scope: ref __binding_4,
                        span: ref __binding_5 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
588pub struct Arm<'tcx> {
589    pub pattern: Box<Pat<'tcx>>,
590    pub guard: Option<ExprId>,
591    pub body: ExprId,
592    pub hir_id: HirId,
593    pub scope: region::Scope,
594    pub span: Span,
595}
596
597/// The `match` part of a `#[loop_match]`
598#[derive(#[automatically_derived]impl ::core::clone::Clone for LoopMatchMatchData {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        LoopMatchMatchData {
            scrutinee: ::core::clone::Clone::clone(&self.scrutinee),
            arms: ::core::clone::Clone::clone(&self.arms),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for LoopMatchMatchData {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "LoopMatchMatchData scrutinee arms span", &self.scrutinee,
            &self.arms, &&self.span)
    }
}Debug, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            LoopMatchMatchData {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    LoopMatchMatchData {
                        scrutinee: ref __binding_0,
                        arms: ref __binding_1,
                        span: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
599pub struct LoopMatchMatchData {
600    pub scrutinee: ExprId,
601    pub arms: Box<[ArmId]>,
602    pub span: Span,
603}
604
605#[derive(#[automatically_derived]impl ::core::marker::Copy for LogicalOp { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for LogicalOp {
}
#[automatically_derived]impl ::core::clone::Clone for LogicalOp {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for LogicalOp {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self { LogicalOp::And => "And", LogicalOp::Or => "Or", })
    }
}Debug, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for LogicalOp {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    LogicalOp::And => 0u8.stable_hash(__hcx, __hasher),
                    LogicalOp::Or => 1u8.stable_hash(__hcx, __hasher),
                }
                match *self { LogicalOp::And => {} LogicalOp::Or => {} }
            }
        }
    };StableHash)]
606pub enum LogicalOp {
607    /// The `&&` operator.
608    And,
609    /// The `||` operator.
610    Or,
611}
612
613#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    InlineAsmOperand<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        match self {
            Self::In { reg: __self_0, expr: __self_1 } =>
                InlineAsmOperand::In {
                    reg: ::core::clone::Clone::clone(__self_0),
                    expr: ::core::clone::Clone::clone(__self_1),
                },
            Self::Out { reg: __self_0, late: __self_1, expr: __self_2 } =>
                InlineAsmOperand::Out {
                    reg: ::core::clone::Clone::clone(__self_0),
                    late: ::core::clone::Clone::clone(__self_1),
                    expr: ::core::clone::Clone::clone(__self_2),
                },
            Self::InOut { reg: __self_0, late: __self_1, expr: __self_2 } =>
                InlineAsmOperand::InOut {
                    reg: ::core::clone::Clone::clone(__self_0),
                    late: ::core::clone::Clone::clone(__self_1),
                    expr: ::core::clone::Clone::clone(__self_2),
                },
            Self::SplitInOut {
                reg: __self_0,
                late: __self_1,
                in_expr: __self_2,
                out_expr: __self_3 } =>
                InlineAsmOperand::SplitInOut {
                    reg: ::core::clone::Clone::clone(__self_0),
                    late: ::core::clone::Clone::clone(__self_1),
                    in_expr: ::core::clone::Clone::clone(__self_2),
                    out_expr: ::core::clone::Clone::clone(__self_3),
                },
            Self::Const { value: __self_0, span: __self_1 } =>
                InlineAsmOperand::Const {
                    value: ::core::clone::Clone::clone(__self_0),
                    span: ::core::clone::Clone::clone(__self_1),
                },
            Self::SymFn { value: __self_0 } =>
                InlineAsmOperand::SymFn {
                    value: ::core::clone::Clone::clone(__self_0),
                },
            Self::SymStatic { def_id: __self_0 } =>
                InlineAsmOperand::SymStatic {
                    def_id: ::core::clone::Clone::clone(__self_0),
                },
            Self::Label { block: __self_0 } =>
                InlineAsmOperand::Label {
                    block: ::core::clone::Clone::clone(__self_0),
                },
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    InlineAsmOperand<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::In { reg: __self_0, expr: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "In reg expr", __self_0, &__self_1),
            Self::Out { reg: __self_0, late: __self_1, expr: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Out reg late expr", __self_0, __self_1, &__self_2),
            Self::InOut { reg: __self_0, late: __self_1, expr: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "InOut reg late expr", __self_0, __self_1, &__self_2),
            Self::SplitInOut {
                reg: __self_0,
                late: __self_1,
                in_expr: __self_2,
                out_expr: __self_3 } =>
                ::core::fmt::Formatter::debug_struct_field4_finish(f,
                    "SplitInOut reg late in_expr out_expr", __self_0, __self_1,
                    __self_2, &__self_3),
            Self::Const { value: __self_0, span: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Const value span", __self_0, &__self_1),
            Self::SymFn { value: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SymFn value", &__self_0),
            Self::SymStatic { def_id: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SymStatic def_id", &__self_0),
            Self::Label { block: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Label block", &__self_0),
        }
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            InlineAsmOperand<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    InlineAsmOperand::In {
                        reg: ref __binding_0, expr: ref __binding_1 } =>
                        0u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::Out {
                        reg: ref __binding_0,
                        late: ref __binding_1,
                        expr: ref __binding_2 } => 1u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::InOut {
                        reg: ref __binding_0,
                        late: ref __binding_1,
                        expr: ref __binding_2 } => 2u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::SplitInOut {
                        reg: ref __binding_0,
                        late: ref __binding_1,
                        in_expr: ref __binding_2,
                        out_expr: ref __binding_3 } =>
                        3u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::Const {
                        value: ref __binding_0, span: ref __binding_1 } =>
                        4u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::SymFn { value: ref __binding_0 } =>
                        5u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::SymStatic { def_id: ref __binding_0 } =>
                        6u8.stable_hash(__hcx, __hasher),
                    InlineAsmOperand::Label { block: ref __binding_0 } =>
                        7u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    InlineAsmOperand::In {
                        reg: ref __binding_0, expr: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::Out {
                        reg: ref __binding_0,
                        late: ref __binding_1,
                        expr: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::InOut {
                        reg: ref __binding_0,
                        late: ref __binding_1,
                        expr: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::SplitInOut {
                        reg: ref __binding_0,
                        late: ref __binding_1,
                        in_expr: ref __binding_2,
                        out_expr: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::Const {
                        value: ref __binding_0, span: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::SymFn { value: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::SymStatic { def_id: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    InlineAsmOperand::Label { block: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
614pub enum InlineAsmOperand<'tcx> {
615    In {
616        reg: InlineAsmRegOrRegClass,
617        expr: ExprId,
618    },
619    Out {
620        reg: InlineAsmRegOrRegClass,
621        late: bool,
622        expr: Option<ExprId>,
623    },
624    InOut {
625        reg: InlineAsmRegOrRegClass,
626        late: bool,
627        expr: ExprId,
628    },
629    SplitInOut {
630        reg: InlineAsmRegOrRegClass,
631        late: bool,
632        in_expr: ExprId,
633        out_expr: Option<ExprId>,
634    },
635    Const {
636        value: mir::Const<'tcx>,
637        span: Span,
638    },
639    SymFn {
640        value: ExprId,
641    },
642    SymStatic {
643        def_id: DefId,
644    },
645    Label {
646        block: BlockId,
647    },
648}
649
650#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for FieldPat<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        FieldPat {
            field: ::core::clone::Clone::clone(&self.field),
            pattern: ::core::clone::Clone::clone(&self.pattern),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for FieldPat<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "FieldPat field pattern", &self.field, &&self.pattern)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            FieldPat<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    FieldPat { field: ref __binding_0, pattern: ref __binding_1
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for FieldPat<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    FieldPat { field: ref __binding_0, pattern: ref __binding_1
                        } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
651pub struct FieldPat<'tcx> {
652    pub field: FieldIdx,
653    pub pattern: Pat<'tcx>,
654}
655
656/// Additional per-node data that is not present on most THIR pattern nodes.
657#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for PatExtra<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        PatExtra {
            expanded_const: ::core::clone::Clone::clone(&self.expanded_const),
            expanded_const_value: ::core::clone::Clone::clone(&self.expanded_const_value),
            ascriptions: ::core::clone::Clone::clone(&self.ascriptions),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for PatExtra<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "PatExtra expanded_const expanded_const_value ascriptions",
            &self.expanded_const, &self.expanded_const_value,
            &&self.ascriptions)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::default::Default for PatExtra<'tcx>
    {
    #[inline]
    fn default() -> Self {
        PatExtra {
            expanded_const: ::core::default::Default::default(),
            expanded_const_value: ::core::default::Default::default(),
            ascriptions: ::core::default::Default::default(),
        }
    }
}Default, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            PatExtra<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    PatExtra {
                        expanded_const: ref __binding_0,
                        expanded_const_value: ref __binding_1,
                        ascriptions: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for PatExtra<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    PatExtra {
                        expanded_const: ref __binding_0,
                        expanded_const_value: ref __binding_1,
                        ascriptions: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
658pub struct PatExtra<'tcx> {
659    /// If present, this node represents a named constant that was lowered to
660    /// a pattern using `const_to_pat`.
661    ///
662    /// This is used by some diagnostics for non-exhaustive matches, to map
663    /// the pattern node back to the `DefId` of its original constant.
664    pub expanded_const: Option<ty::AliasConstKind<'tcx>>,
665
666    /// If present, the original constant value that this array or slice
667    /// pattern node was expanded from by `const_to_pat`.
668    ///
669    /// Match lowering uses this to compare the scrutinee against the original
670    /// constant as a whole, rather than element by element.
671    pub expanded_const_value: Option<ty::Value<'tcx>>,
672
673    /// User-written types that must be preserved into MIR so that they can be
674    /// checked.
675    pub ascriptions: Vec<Ascription<'tcx>>,
676}
677
678#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for Pat<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Pat {
            ty: ::core::clone::Clone::clone(&self.ty),
            span: ::core::clone::Clone::clone(&self.span),
            extra: ::core::clone::Clone::clone(&self.extra),
            kind: ::core::clone::Clone::clone(&self.kind),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for Pat<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "Pat ty span extra kind", &self.ty, &self.span, &self.extra,
            &&self.kind)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Pat<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Pat {
                        ty: ref __binding_0,
                        span: ref __binding_1,
                        extra: ref __binding_2,
                        kind: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for Pat<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    Pat {
                        ty: ref __binding_0,
                        span: ref __binding_1,
                        extra: ref __binding_2,
                        kind: ref __binding_3 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
679pub struct Pat<'tcx> {
680    pub ty: Ty<'tcx>,
681    pub span: Span,
682    pub extra: Option<Box<PatExtra<'tcx>>>,
683    pub kind: PatKind<'tcx>,
684}
685
686impl<'tcx> Pat<'tcx> {
687    pub fn simple_ident(&self) -> Option<Symbol> {
688        match self.kind {
689            PatKind::Binding {
690                name, mode: BindingMode(ByRef::No, _), subpattern: None, ..
691            } => Some(name),
692            _ => None,
693        }
694    }
695
696    /// Call `f` on every "binding" in a pattern, e.g., on `a` in
697    /// `match foo() { Some(a) => (), None => () }`
698    pub fn each_binding(&self, mut f: impl FnMut(Symbol, ByRef, Ty<'tcx>, Span)) {
699        self.walk_always(|p| {
700            if let PatKind::Binding { name, mode, ty, .. } = p.kind {
701                f(name, mode.0, ty, p.span);
702            }
703        });
704    }
705
706    /// Walk the pattern in left-to-right order.
707    ///
708    /// If `it(pat)` returns `false`, the children are not visited.
709    pub fn walk(&self, mut it: impl FnMut(&Pat<'tcx>) -> bool) {
710        self.walk_(&mut it)
711    }
712
713    fn walk_(&self, it: &mut impl FnMut(&Pat<'tcx>) -> bool) {
714        if !it(self) {
715            return;
716        }
717
718        for_each_immediate_subpat(self, |p| p.walk_(it));
719    }
720
721    /// Whether the pattern has a `PatKind::Error` nested within.
722    pub fn pat_error_reported(&self) -> Result<(), ErrorGuaranteed> {
723        let mut error = None;
724        self.walk(|pat| {
725            if let PatKind::Error(e) = pat.kind
726                && error.is_none()
727            {
728                error = Some(e);
729            }
730            error.is_none()
731        });
732        match error {
733            None => Ok(()),
734            Some(e) => Err(e),
735        }
736    }
737
738    /// Walk the pattern in left-to-right order.
739    ///
740    /// If you always want to recurse, prefer this method over `walk`.
741    pub fn walk_always(&self, mut it: impl FnMut(&Pat<'tcx>)) {
742        self.walk(|p| {
743            it(p);
744            true
745        })
746    }
747}
748
749#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for Ascription<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        Ascription {
            annotation: ::core::clone::Clone::clone(&self.annotation),
            variance: ::core::clone::Clone::clone(&self.variance),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for Ascription<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "Ascription annotation variance", &self.annotation,
            &&self.variance)
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            Ascription<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    Ascription {
                        annotation: ref __binding_0, variance: ref __binding_1 } =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for Ascription<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    Ascription {
                        annotation: ref __binding_0, variance: ref __binding_1 } =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
750pub struct Ascription<'tcx> {
751    pub annotation: CanonicalUserTypeAnnotation<'tcx>,
752    /// Variance to use when relating the `user_ty` to the **type of the value being
753    /// matched**. Typically, this is `Variance::Covariant`, since the value being matched must
754    /// have a type that is some subtype of the ascribed type.
755    ///
756    /// Note that this variance does not apply for any bindings within subpatterns. The type
757    /// assigned to those bindings must be exactly equal to the `user_ty` given here.
758    ///
759    /// The only place where this field is not `Covariant` is when matching constants, where
760    /// we currently use `Contravariant` -- this is because the constant type just needs to
761    /// be "comparable" to the type of the input value. So, for example:
762    ///
763    /// ```text
764    /// match x { "foo" => .. }
765    /// ```
766    ///
767    /// requires that `&'static str <: T_x`, where `T_x` is the type of `x`. Really, we should
768    /// probably be checking for a `PartialEq` impl instead, but this preserves the behavior
769    /// of the old type-check for now. See #57280 for details.
770    pub variance: ty::Variance,
771}
772
773#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for PatKind<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        match self {
            Self::Missing => PatKind::Missing,
            Self::Wild => PatKind::Wild,
            Self::Binding {
                name: __self_0,
                mode: __self_1,
                var: __self_2,
                ty: __self_3,
                subpattern: __self_4,
                is_primary: __self_5,
                is_shorthand: __self_6 } =>
                PatKind::Binding {
                    name: ::core::clone::Clone::clone(__self_0),
                    mode: ::core::clone::Clone::clone(__self_1),
                    var: ::core::clone::Clone::clone(__self_2),
                    ty: ::core::clone::Clone::clone(__self_3),
                    subpattern: ::core::clone::Clone::clone(__self_4),
                    is_primary: ::core::clone::Clone::clone(__self_5),
                    is_shorthand: ::core::clone::Clone::clone(__self_6),
                },
            Self::Variant {
                adt_def: __self_0,
                args: __self_1,
                variant_index: __self_2,
                subpatterns: __self_3 } =>
                PatKind::Variant {
                    adt_def: ::core::clone::Clone::clone(__self_0),
                    args: ::core::clone::Clone::clone(__self_1),
                    variant_index: ::core::clone::Clone::clone(__self_2),
                    subpatterns: ::core::clone::Clone::clone(__self_3),
                },
            Self::Leaf { subpatterns: __self_0 } =>
                PatKind::Leaf {
                    subpatterns: ::core::clone::Clone::clone(__self_0),
                },
            Self::Deref { pin: __self_0, subpattern: __self_1 } =>
                PatKind::Deref {
                    pin: ::core::clone::Clone::clone(__self_0),
                    subpattern: ::core::clone::Clone::clone(__self_1),
                },
            Self::DerefPattern { subpattern: __self_0, borrow: __self_1 } =>
                PatKind::DerefPattern {
                    subpattern: ::core::clone::Clone::clone(__self_0),
                    borrow: ::core::clone::Clone::clone(__self_1),
                },
            Self::Constant { value: __self_0 } =>
                PatKind::Constant {
                    value: ::core::clone::Clone::clone(__self_0),
                },
            Self::Range(__self_0) =>
                PatKind::Range(::core::clone::Clone::clone(__self_0)),
            Self::Slice { prefix: __self_0, slice: __self_1, suffix: __self_2
                } =>
                PatKind::Slice {
                    prefix: ::core::clone::Clone::clone(__self_0),
                    slice: ::core::clone::Clone::clone(__self_1),
                    suffix: ::core::clone::Clone::clone(__self_2),
                },
            Self::Array { prefix: __self_0, slice: __self_1, suffix: __self_2
                } =>
                PatKind::Array {
                    prefix: ::core::clone::Clone::clone(__self_0),
                    slice: ::core::clone::Clone::clone(__self_1),
                    suffix: ::core::clone::Clone::clone(__self_2),
                },
            Self::Or { pats: __self_0 } =>
                PatKind::Or { pats: ::core::clone::Clone::clone(__self_0) },
            Self::Guard { subpattern: __self_0, condition: __self_1 } =>
                PatKind::Guard {
                    subpattern: ::core::clone::Clone::clone(__self_0),
                    condition: ::core::clone::Clone::clone(__self_1),
                },
            Self::Never => PatKind::Never,
            Self::Error(__self_0) =>
                PatKind::Error(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for PatKind<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Missing => ::core::fmt::Formatter::write_str(f, "Missing"),
            Self::Wild => ::core::fmt::Formatter::write_str(f, "Wild"),
            Self::Binding {
                name: __self_0,
                mode: __self_1,
                var: __self_2,
                ty: __self_3,
                subpattern: __self_4,
                is_primary: __self_5,
                is_shorthand: __self_6 } =>
                ::core::fmt::Formatter::debug_struct_fields_finish(f,
                    "Binding name mode var ty subpattern is_primary is_shorthand",
                    &[__self_0, __self_1, __self_2, __self_3, __self_4,
                                __self_5, &__self_6]),
            Self::Variant {
                adt_def: __self_0,
                args: __self_1,
                variant_index: __self_2,
                subpatterns: __self_3 } =>
                ::core::fmt::Formatter::debug_struct_field4_finish(f,
                    "Variant adt_def args variant_index subpatterns", __self_0,
                    __self_1, __self_2, &__self_3),
            Self::Leaf { subpatterns: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Leaf subpatterns", &__self_0),
            Self::Deref { pin: __self_0, subpattern: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Deref pin subpattern", __self_0, &__self_1),
            Self::DerefPattern { subpattern: __self_0, borrow: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "DerefPattern subpattern borrow", __self_0, &__self_1),
            Self::Constant { value: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Constant value", &__self_0),
            Self::Range(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Range",
                    &__self_0),
            Self::Slice { prefix: __self_0, slice: __self_1, suffix: __self_2
                } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Slice prefix slice suffix", __self_0, __self_1, &__self_2),
            Self::Array { prefix: __self_0, slice: __self_1, suffix: __self_2
                } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Array prefix slice suffix", __self_0, __self_1, &__self_2),
            Self::Or { pats: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Or pats", &__self_0),
            Self::Guard { subpattern: __self_0, condition: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Guard subpattern condition", __self_0, &__self_1),
            Self::Never => ::core::fmt::Formatter::write_str(f, "Never"),
            Self::Error(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Error",
                    &__self_0),
        }
    }
}Debug, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            PatKind<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    PatKind::Missing => 0u8.stable_hash(__hcx, __hasher),
                    PatKind::Wild => 1u8.stable_hash(__hcx, __hasher),
                    PatKind::Binding {
                        name: ref __binding_0,
                        mode: ref __binding_1,
                        var: ref __binding_2,
                        ty: ref __binding_3,
                        subpattern: ref __binding_4,
                        is_primary: ref __binding_5,
                        is_shorthand: ref __binding_6 } =>
                        2u8.stable_hash(__hcx, __hasher),
                    PatKind::Variant {
                        adt_def: ref __binding_0,
                        args: ref __binding_1,
                        variant_index: ref __binding_2,
                        subpatterns: ref __binding_3 } =>
                        3u8.stable_hash(__hcx, __hasher),
                    PatKind::Leaf { subpatterns: ref __binding_0 } =>
                        4u8.stable_hash(__hcx, __hasher),
                    PatKind::Deref {
                        pin: ref __binding_0, subpattern: ref __binding_1 } =>
                        5u8.stable_hash(__hcx, __hasher),
                    PatKind::DerefPattern {
                        subpattern: ref __binding_0, borrow: ref __binding_1 } =>
                        6u8.stable_hash(__hcx, __hasher),
                    PatKind::Constant { value: ref __binding_0 } =>
                        7u8.stable_hash(__hcx, __hasher),
                    PatKind::Range(ref __binding_0) =>
                        8u8.stable_hash(__hcx, __hasher),
                    PatKind::Slice {
                        prefix: ref __binding_0,
                        slice: ref __binding_1,
                        suffix: ref __binding_2 } =>
                        9u8.stable_hash(__hcx, __hasher),
                    PatKind::Array {
                        prefix: ref __binding_0,
                        slice: ref __binding_1,
                        suffix: ref __binding_2 } =>
                        10u8.stable_hash(__hcx, __hasher),
                    PatKind::Or { pats: ref __binding_0 } =>
                        11u8.stable_hash(__hcx, __hasher),
                    PatKind::Guard {
                        subpattern: ref __binding_0, condition: ref __binding_1 } =>
                        12u8.stable_hash(__hcx, __hasher),
                    PatKind::Never => 13u8.stable_hash(__hcx, __hasher),
                    PatKind::Error(ref __binding_0) =>
                        14u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    PatKind::Missing => {}
                    PatKind::Wild => {}
                    PatKind::Binding {
                        name: ref __binding_0,
                        mode: ref __binding_1,
                        var: ref __binding_2,
                        ty: ref __binding_3,
                        subpattern: ref __binding_4,
                        is_primary: ref __binding_5,
                        is_shorthand: ref __binding_6 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                        { __binding_6.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Variant {
                        adt_def: ref __binding_0,
                        args: ref __binding_1,
                        variant_index: ref __binding_2,
                        subpatterns: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Leaf { subpatterns: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Deref {
                        pin: ref __binding_0, subpattern: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::DerefPattern {
                        subpattern: ref __binding_0, borrow: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Constant { value: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Range(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Slice {
                        prefix: ref __binding_0,
                        slice: ref __binding_1,
                        suffix: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Array {
                        prefix: ref __binding_0,
                        slice: ref __binding_1,
                        suffix: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Or { pats: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Guard {
                        subpattern: ref __binding_0, condition: ref __binding_1 } =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    PatKind::Never => {}
                    PatKind::Error(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for PatKind<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    PatKind::Missing => {}
                    PatKind::Wild => {}
                    PatKind::Binding {
                        name: ref __binding_0,
                        ty: ref __binding_3,
                        subpattern: ref __binding_4,
                        is_primary: ref __binding_5,
                        is_shorthand: ref __binding_6, .. } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_4,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_5,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_6,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Variant {
                        adt_def: ref __binding_0,
                        args: ref __binding_1,
                        variant_index: ref __binding_2,
                        subpatterns: ref __binding_3 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Leaf { subpatterns: ref __binding_0 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Deref { subpattern: ref __binding_1, .. } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::DerefPattern { subpattern: ref __binding_0, .. } =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Constant { value: ref __binding_0 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Range(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Slice {
                        prefix: ref __binding_0,
                        slice: ref __binding_1,
                        suffix: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Array {
                        prefix: ref __binding_0,
                        slice: ref __binding_1,
                        suffix: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Or { pats: ref __binding_0 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Guard { subpattern: ref __binding_0, .. } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatKind::Never => {}
                    PatKind::Error(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
774pub enum PatKind<'tcx> {
775    /// A missing pattern, e.g. for an anonymous param in a bare fn like `fn f(u32)`.
776    Missing,
777
778    /// A wildcard pattern: `_`.
779    Wild,
780
781    /// `x`, `ref x`, `x @ P`, etc.
782    Binding {
783        name: Symbol,
784        #[type_visitable(ignore)]
785        mode: BindingMode,
786        #[type_visitable(ignore)]
787        var: LocalVarId,
788        ty: Ty<'tcx>,
789        subpattern: Option<Box<Pat<'tcx>>>,
790
791        /// Is this the leftmost occurrence of the binding, i.e., is `var` the
792        /// `HirId` of this pattern?
793        ///
794        /// (The same binding can occur multiple times in different branches of
795        /// an or-pattern, but only one of them will be primary.)
796        is_primary: bool,
797        /// Is this binding a shorthand struct pattern, i.e. `Foo { a }`?
798        is_shorthand: bool,
799    },
800
801    /// `Foo(...)` or `Foo{...}` or `Foo`, where `Foo` is a variant name from an ADT with
802    /// multiple variants.
803    Variant {
804        adt_def: AdtDef<'tcx>,
805        args: GenericArgs<'tcx>,
806        variant_index: VariantIdx,
807        subpatterns: Vec<FieldPat<'tcx>>,
808    },
809
810    /// `(...)`, `Foo(...)`, `Foo{...}`, or `Foo`, where `Foo` is a variant name from an ADT with
811    /// a single variant.
812    Leaf {
813        subpatterns: Vec<FieldPat<'tcx>>,
814    },
815
816    /// Explicit or implicit `&P` or `&mut P`, for some subpattern `P`.
817    ///
818    /// Implicit `&`/`&mut` patterns can be inserted by match-ergonomics.
819    ///
820    /// With `feature(pin_ergonomics)`, this can also be `&pin const P` or
821    /// `&pin mut P`, as indicated by the `pin` field.
822    Deref {
823        #[type_visitable(ignore)]
824        pin: hir::Pinnedness,
825        subpattern: Box<Pat<'tcx>>,
826    },
827
828    /// Explicit or implicit `deref!(..)` pattern, under `feature(deref_patterns)`.
829    /// Represents a call to `Deref` or `DerefMut`, or a deref-move of `Box`.
830    DerefPattern {
831        subpattern: Box<Pat<'tcx>>,
832        /// Whether the pattern scrutinee needs to be borrowed in order to call `Deref::deref` or
833        /// `DerefMut::deref_mut`, and if so, which. This is `DerefPatBorrowMode::Box` for deref patterns on
834        /// boxes; they are lowered using a built-in deref rather than a method call, thus they
835        /// don't borrow the scrutinee.
836        #[type_visitable(ignore)]
837        borrow: DerefPatBorrowMode,
838    },
839
840    /// One of the following:
841    /// * `&str`, which will be handled as a string pattern and thus
842    ///   exhaustiveness checking will detect if you use the same string twice in different
843    ///   patterns.
844    /// * integer, bool, char or float, which will be handled by
845    ///   exhaustiveness to cover exactly its own value, similar to `&str`, but these values are
846    ///   much simpler.
847    /// * raw pointers derived from integers, other raw pointers will have already resulted in an
848    ///   error.
849    Constant {
850        value: ty::Value<'tcx>,
851    },
852
853    Range(Arc<PatRange<'tcx>>),
854
855    /// Matches against a slice, checking the length and extracting elements.
856    /// irrefutable when there is a slice pattern and both `prefix` and `suffix` are empty.
857    /// e.g., `&[ref xs @ ..]`.
858    Slice {
859        prefix: Box<[Pat<'tcx>]>,
860        slice: Option<Box<Pat<'tcx>>>,
861        suffix: Box<[Pat<'tcx>]>,
862    },
863
864    /// Fixed match against an array; irrefutable.
865    Array {
866        prefix: Box<[Pat<'tcx>]>,
867        slice: Option<Box<Pat<'tcx>>>,
868        suffix: Box<[Pat<'tcx>]>,
869    },
870
871    /// An or-pattern, e.g. `p | q`.
872    /// Invariant: `pats.len() >= 2`.
873    Or {
874        pats: Box<[Pat<'tcx>]>,
875    },
876
877    /// A guard pattern, e.g. `x if guard(x)`
878    Guard {
879        subpattern: Box<Pat<'tcx>>,
880        #[type_visitable(ignore)]
881        condition: ExprId,
882    },
883
884    /// A never pattern `!`.
885    Never,
886
887    /// An error has been encountered during lowering. We probably shouldn't report more lints
888    /// related to this pattern.
889    Error(ErrorGuaranteed),
890}
891
892#[derive(#[automatically_derived]impl ::core::marker::Copy for DerefPatBorrowMode { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for DerefPatBorrowMode {
}
#[automatically_derived]impl ::core::clone::Clone for DerefPatBorrowMode {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Mutability>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for DerefPatBorrowMode {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Borrow(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Borrow", &__self_0),
            Self::Box => ::core::fmt::Formatter::write_str(f, "Box"),
        }
    }
}Debug, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            DerefPatBorrowMode {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    DerefPatBorrowMode::Borrow(ref __binding_0) =>
                        0u8.stable_hash(__hcx, __hasher),
                    DerefPatBorrowMode::Box => 1u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    DerefPatBorrowMode::Borrow(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    DerefPatBorrowMode::Box => {}
                }
            }
        }
    };StableHash)]
893pub enum DerefPatBorrowMode {
894    Borrow(Mutability),
895    Box,
896}
897
898/// A range pattern.
899/// The boundaries must be of the same type and that type must be numeric.
900#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for PatRange<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        PatRange {
            lo: ::core::clone::Clone::clone(&self.lo),
            hi: ::core::clone::Clone::clone(&self.hi),
            end: ::core::clone::Clone::clone(&self.end),
            ty: ::core::clone::Clone::clone(&self.ty),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for PatRange<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "PatRange lo hi end ty", &self.lo, &self.hi, &self.end, &&self.ty)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    PatRange<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for PatRange<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.lo == other.lo && self.hi == other.hi && self.end == other.end &&
            self.ty == other.ty
    }
}PartialEq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            PatRange<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    PatRange {
                        lo: ref __binding_0,
                        hi: ref __binding_1,
                        end: ref __binding_2,
                        ty: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for PatRange<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    PatRange {
                        lo: ref __binding_0,
                        hi: ref __binding_1,
                        ty: ref __binding_3, .. } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
901pub struct PatRange<'tcx> {
902    /// Must not be `PosInfinity`.
903    pub lo: PatRangeBoundary<'tcx>,
904    /// Must not be `NegInfinity`.
905    pub hi: PatRangeBoundary<'tcx>,
906    #[type_visitable(ignore)]
907    pub end: RangeEnd,
908    pub ty: Ty<'tcx>,
909}
910
911impl<'tcx> PatRange<'tcx> {
912    /// Whether this range covers the full extent of possible values (best-effort, we ignore floats).
913    #[inline]
914    pub fn is_full_range(&self, tcx: TyCtxt<'tcx>) -> Option<bool> {
915        let (min, max, size, bias) = match *self.ty.kind() {
916            ty::Char => (0, std::char::MAX as u128, Size::from_bits(32), 0),
917            ty::Int(ity) => {
918                let size = Integer::from_int_ty(&tcx, ity).size();
919                let max = size.truncate(u128::MAX);
920                let bias = 1u128 << (size.bits() - 1);
921                (0, max, size, bias)
922            }
923            ty::Uint(uty) => {
924                let size = Integer::from_uint_ty(&tcx, uty).size();
925                let max = size.unsigned_int_max();
926                (0, max, size, 0)
927            }
928            _ => return None,
929        };
930
931        // We want to compare ranges numerically, but the order of the bitwise representation of
932        // signed integers does not match their numeric order. Thus, to correct the ordering, we
933        // need to shift the range of signed integers to correct the comparison. This is achieved by
934        // XORing with a bias (see pattern/deconstruct_pat.rs for another pertinent example of this
935        // pattern).
936        //
937        // Also, for performance, it's important to only do the second `try_to_bits` if necessary.
938        let lo_is_min = match self.lo {
939            PatRangeBoundary::NegInfinity => true,
940            PatRangeBoundary::Finite(value) => {
941                let lo = value.to_leaf().to_bits(size) ^ bias;
942                lo <= min
943            }
944            PatRangeBoundary::PosInfinity => false,
945        };
946        if lo_is_min {
947            let hi_is_max = match self.hi {
948                PatRangeBoundary::NegInfinity => false,
949                PatRangeBoundary::Finite(value) => {
950                    let hi = value.to_leaf().to_bits(size) ^ bias;
951                    hi > max || hi == max && self.end == RangeEnd::Included
952                }
953                PatRangeBoundary::PosInfinity => true,
954            };
955            if hi_is_max {
956                return Some(true);
957            }
958        }
959        Some(false)
960    }
961
962    #[inline]
963    pub fn contains(&self, value: ty::Value<'tcx>, tcx: TyCtxt<'tcx>) -> Option<bool> {
964        use Ordering::*;
965        if true {
    {
        match (&value.ty, &self.ty) {
            (left_val, right_val) => {
                if !(*left_val == *right_val) {
                    let kind = ::core::panicking::AssertKind::Eq;
                    ::core::panicking::assert_failed(kind, &*left_val,
                        &*right_val, ::core::option::Option::None);
                }
            }
        }
    };
};debug_assert_eq!(value.ty, self.ty);
966        let ty = self.ty;
967        let value = PatRangeBoundary::Finite(value.valtree);
968        // For performance, it's important to only do the second comparison if necessary.
969        Some(
970            match self.lo.compare_with(value, ty, tcx)? {
971                Less | Equal => true,
972                Greater => false,
973            } && match value.compare_with(self.hi, ty, tcx)? {
974                Less => true,
975                Equal => self.end == RangeEnd::Included,
976                Greater => false,
977            },
978        )
979    }
980
981    #[inline]
982    pub fn overlaps(&self, other: &Self, tcx: TyCtxt<'tcx>) -> Option<bool> {
983        use Ordering::*;
984        if true {
    {
        match (&self.ty, &other.ty) {
            (left_val, right_val) => {
                if !(*left_val == *right_val) {
                    let kind = ::core::panicking::AssertKind::Eq;
                    ::core::panicking::assert_failed(kind, &*left_val,
                        &*right_val, ::core::option::Option::None);
                }
            }
        }
    };
};debug_assert_eq!(self.ty, other.ty);
985        // For performance, it's important to only do the second comparison if necessary.
986        Some(
987            match other.lo.compare_with(self.hi, self.ty, tcx)? {
988                Less => true,
989                Equal => self.end == RangeEnd::Included,
990                Greater => false,
991            } && match self.lo.compare_with(other.hi, self.ty, tcx)? {
992                Less => true,
993                Equal => other.end == RangeEnd::Included,
994                Greater => false,
995            },
996        )
997    }
998}
999
1000impl<'tcx> fmt::Display for PatRange<'tcx> {
1001    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1002        if let &PatRangeBoundary::Finite(valtree) = &self.lo {
1003            let value = ty::Value { ty: self.ty, valtree };
1004            f.write_fmt(format_args!("{0}", value))write!(f, "{value}")?;
1005        }
1006        if let &PatRangeBoundary::Finite(valtree) = &self.hi {
1007            f.write_fmt(format_args!("{0}", self.end))write!(f, "{}", self.end)?;
1008            let value = ty::Value { ty: self.ty, valtree };
1009            f.write_fmt(format_args!("{0}", value))write!(f, "{value}")?;
1010        } else {
1011            // `0..` is parsed as an inclusive range, we must display it correctly.
1012            f.write_fmt(format_args!(".."))write!(f, "..")?;
1013        }
1014        Ok(())
1015    }
1016}
1017
1018/// A (possibly open) boundary of a range pattern.
1019/// If present, the const must be of a numeric type.
1020#[derive(#[automatically_derived]impl<'tcx> ::core::marker::Copy for
    PatRangeBoundary<'tcx> {
}Copy, #[automatically_derived]#[doc(hidden)]unsafe impl<'tcx>
    ::core::clone::TrivialClone for PatRangeBoundary<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    PatRangeBoundary<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<ty::ValTree<'tcx>>;
        *self
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    PatRangeBoundary<'tcx> {
    #[inline]
    #[rustc_trivial_field_reads]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Finite(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Finite", &__self_0),
            Self::NegInfinity =>
                ::core::fmt::Formatter::write_str(f, "NegInfinity"),
            Self::PosInfinity =>
                ::core::fmt::Formatter::write_str(f, "PosInfinity"),
        }
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    PatRangeBoundary<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    PatRangeBoundary<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Finite(__self_0), Self::Finite(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            PatRangeBoundary<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    PatRangeBoundary::Finite(ref __binding_0) =>
                        0u8.stable_hash(__hcx, __hasher),
                    PatRangeBoundary::NegInfinity =>
                        1u8.stable_hash(__hcx, __hasher),
                    PatRangeBoundary::PosInfinity =>
                        2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    PatRangeBoundary::Finite(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    PatRangeBoundary::NegInfinity => {}
                    PatRangeBoundary::PosInfinity => {}
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for PatRangeBoundary<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    PatRangeBoundary::Finite(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    PatRangeBoundary::NegInfinity => {}
                    PatRangeBoundary::PosInfinity => {}
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
1021pub enum PatRangeBoundary<'tcx> {
1022    /// The type of this valtree is stored in the surrounding `PatRange`.
1023    Finite(ty::ValTree<'tcx>),
1024    NegInfinity,
1025    PosInfinity,
1026}
1027
1028impl<'tcx> PatRangeBoundary<'tcx> {
1029    #[inline]
1030    pub fn is_finite(self) -> bool {
1031        #[allow(non_exhaustive_omitted_patterns)] match self {
    Self::Finite(..) => true,
    _ => false,
}matches!(self, Self::Finite(..))
1032    }
1033    #[inline]
1034    pub fn as_finite(self) -> Option<ty::ValTree<'tcx>> {
1035        match self {
1036            Self::Finite(value) => Some(value),
1037            Self::NegInfinity | Self::PosInfinity => None,
1038        }
1039    }
1040    pub fn to_bits(self, ty: Ty<'tcx>, tcx: TyCtxt<'tcx>) -> u128 {
1041        match self {
1042            Self::Finite(value) => value.to_leaf().to_bits_unchecked(),
1043            Self::NegInfinity => {
1044                // Unwrap is ok because the type is known to be numeric.
1045                ty.numeric_min_and_max_as_bits(tcx).unwrap().0
1046            }
1047            Self::PosInfinity => {
1048                // Unwrap is ok because the type is known to be numeric.
1049                ty.numeric_min_and_max_as_bits(tcx).unwrap().1
1050            }
1051        }
1052    }
1053
1054    {}
let __tracing_attr_span;
let __tracing_attr_guard;
if ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL &&
            ::tracing::Level::DEBUG <=
                ::tracing::level_filters::LevelFilter::current() || { false }
    {
    __tracing_attr_span =
        {
            use ::tracing::__macro_support::Callsite as _;
            static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                {
                    static META: ::tracing::Metadata<'static> =
                        {
                            ::tracing_core::metadata::Metadata::new("compare_with",
                                "rustc_middle::thir", ::tracing::Level::DEBUG,
                                ::tracing_core::__macro_support::Option::Some("/rustc-dev/c82ce15637153c025d29abbaff6035a177361788/compiler/rustc_middle/src/thir.rs"),
                                ::tracing_core::__macro_support::Option::Some(1054u32),
                                ::tracing_core::__macro_support::Option::Some("rustc_middle::thir"),
                                ::tracing_core::field::FieldSet::new(&[{
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("self")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("self");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("other")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("other");
                                                    NAME.as_str()
                                                },
                                                {
                                                    const NAME:
                                                        ::tracing::__macro_support::FieldName<{
                                                            ::tracing::__macro_support::FieldName::len("ty")
                                                        }> =
                                                        ::tracing::__macro_support::FieldName::new("ty");
                                                    NAME.as_str()
                                                }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                ::tracing::metadata::Kind::SPAN)
                        };
                    ::tracing::callsite::DefaultCallsite::new(&META)
                };
            let mut interest = ::tracing::subscriber::Interest::never();
            if ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::DEBUG <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        { interest = __CALLSITE.interest(); !interest.is_never() }
                    &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest) {
                let meta = __CALLSITE.metadata();
                ::tracing::Span::new(meta,
                    &{
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            meta.fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&self)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&other)
                                                        as &dyn ::tracing::field::Value)),
                                            (::tracing::__macro_support::Option::Some(&::tracing::field::debug(&ty)
                                                        as &dyn ::tracing::field::Value))])
                        })
            } else {
                let span =
                    ::tracing::__macro_support::__disabled_span(__CALLSITE.metadata());
                {};
                span
            }
        };
    __tracing_attr_guard = __tracing_attr_span.enter();
}
#[allow(clippy :: redundant_closure_call)]
let x =
    (move ||
                {

                    #[allow(unknown_lints, unreachable_code, clippy ::
                    diverging_sub_expression, clippy :: empty_loop, clippy ::
                    let_unit_value, clippy :: let_with_type_underscore, clippy
                    :: needless_return, clippy :: unreachable)]
                    if false {
                        let __tracing_attr_fake_return: Option<Ordering> = loop {};
                        return __tracing_attr_fake_return;
                    }
                    {
                        use PatRangeBoundary::*;
                        match (self, other) {
                            (PosInfinity, PosInfinity) => return Some(Ordering::Equal),
                            (NegInfinity, NegInfinity) => return Some(Ordering::Equal),
                            (Finite(a), Finite(b)) if
                                #[allow(non_exhaustive_omitted_patterns)] match ty.kind() {
                                    ty::Int(_) | ty::Uint(_) | ty::Char => true,
                                    _ => false,
                                } => {
                                if let (Some(a), Some(b)) =
                                        (a.try_to_leaf(), b.try_to_leaf()) {
                                    let sz = ty.primitive_size(tcx);
                                    let cmp =
                                        match ty.kind() {
                                            ty::Uint(_) | ty::Char => a.to_uint(sz).cmp(&b.to_uint(sz)),
                                            ty::Int(_) => a.to_int(sz).cmp(&b.to_int(sz)),
                                            _ => ::core::panicking::unreachable_default_msg(),
                                        };
                                    return Some(cmp);
                                }
                            }
                            _ => {}
                        }
                        let a = self.to_bits(ty, tcx);
                        let b = other.to_bits(ty, tcx);
                        match ty.kind() {
                            ty::Float(ty::FloatTy::F16) => {
                                use rustc_apfloat::Float;
                                let a = rustc_apfloat::ieee::Half::from_bits(a);
                                let b = rustc_apfloat::ieee::Half::from_bits(b);
                                a.partial_cmp(&b)
                            }
                            ty::Float(ty::FloatTy::F32) => {
                                use rustc_apfloat::Float;
                                let a = rustc_apfloat::ieee::Single::from_bits(a);
                                let b = rustc_apfloat::ieee::Single::from_bits(b);
                                a.partial_cmp(&b)
                            }
                            ty::Float(ty::FloatTy::F64) => {
                                use rustc_apfloat::Float;
                                let a = rustc_apfloat::ieee::Double::from_bits(a);
                                let b = rustc_apfloat::ieee::Double::from_bits(b);
                                a.partial_cmp(&b)
                            }
                            ty::Float(ty::FloatTy::F128) => {
                                use rustc_apfloat::Float;
                                let a = rustc_apfloat::ieee::Quad::from_bits(a);
                                let b = rustc_apfloat::ieee::Quad::from_bits(b);
                                a.partial_cmp(&b)
                            }
                            ty::Int(ity) => {
                                let size =
                                    rustc_abi::Integer::from_int_ty(&tcx, *ity).size();
                                let a = size.sign_extend(a) as i128;
                                let b = size.sign_extend(b) as i128;
                                Some(a.cmp(&b))
                            }
                            ty::Uint(_) | ty::Char => Some(a.cmp(&b)),
                            _ =>
                                ::rustc_span::macros::bug_impl(None,
                                    format_args!("impossible case reached"),
                                    Location::caller()),
                        }
                    }
                })();
{
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event /rustc-dev/c82ce15637153c025d29abbaff6035a177361788/compiler/rustc_middle/src/thir.rs:1054",
                        "rustc_middle::thir", ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("/rustc-dev/c82ce15637153c025d29abbaff6035a177361788/compiler/rustc_middle/src/thir.rs"),
                        ::tracing_core::__macro_support::Option::Some(1054u32),
                        ::tracing_core::__macro_support::Option::Some("rustc_middle::thir"),
                        ::tracing_core::field::FieldSet::new(&[{
                                            const NAME:
                                                ::tracing::__macro_support::FieldName<{
                                                    ::tracing::__macro_support::FieldName::len("return")
                                                }> =
                                                ::tracing::__macro_support::FieldName::new("return");
                                            NAME.as_str()
                                        }], ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&::tracing::field::debug(&x)
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};
x;#[instrument(skip(tcx), level = "debug", ret)]
1055    pub fn compare_with(self, other: Self, ty: Ty<'tcx>, tcx: TyCtxt<'tcx>) -> Option<Ordering> {
1056        use PatRangeBoundary::*;
1057        match (self, other) {
1058            // When comparing with infinities, we must remember that `0u8..` and `0u8..=255`
1059            // describe the same range. These two shortcuts are ok, but for the rest we must check
1060            // bit values.
1061            (PosInfinity, PosInfinity) => return Some(Ordering::Equal),
1062            (NegInfinity, NegInfinity) => return Some(Ordering::Equal),
1063
1064            // This code is hot when compiling matches with many ranges. So we
1065            // special-case extraction of evaluated scalars for speed, for types where
1066            // we can do scalar comparisons. E.g. `unicode-normalization` has
1067            // many ranges such as '\u{037A}'..='\u{037F}', and chars can be compared
1068            // in this way.
1069            (Finite(a), Finite(b)) if matches!(ty.kind(), ty::Int(_) | ty::Uint(_) | ty::Char) => {
1070                if let (Some(a), Some(b)) = (a.try_to_leaf(), b.try_to_leaf()) {
1071                    let sz = ty.primitive_size(tcx);
1072                    let cmp = match ty.kind() {
1073                        ty::Uint(_) | ty::Char => a.to_uint(sz).cmp(&b.to_uint(sz)),
1074                        ty::Int(_) => a.to_int(sz).cmp(&b.to_int(sz)),
1075                        _ => unreachable!(),
1076                    };
1077                    return Some(cmp);
1078                }
1079            }
1080            _ => {}
1081        }
1082
1083        let a = self.to_bits(ty, tcx);
1084        let b = other.to_bits(ty, tcx);
1085
1086        match ty.kind() {
1087            ty::Float(ty::FloatTy::F16) => {
1088                use rustc_apfloat::Float;
1089                let a = rustc_apfloat::ieee::Half::from_bits(a);
1090                let b = rustc_apfloat::ieee::Half::from_bits(b);
1091                a.partial_cmp(&b)
1092            }
1093            ty::Float(ty::FloatTy::F32) => {
1094                use rustc_apfloat::Float;
1095                let a = rustc_apfloat::ieee::Single::from_bits(a);
1096                let b = rustc_apfloat::ieee::Single::from_bits(b);
1097                a.partial_cmp(&b)
1098            }
1099            ty::Float(ty::FloatTy::F64) => {
1100                use rustc_apfloat::Float;
1101                let a = rustc_apfloat::ieee::Double::from_bits(a);
1102                let b = rustc_apfloat::ieee::Double::from_bits(b);
1103                a.partial_cmp(&b)
1104            }
1105            ty::Float(ty::FloatTy::F128) => {
1106                use rustc_apfloat::Float;
1107                let a = rustc_apfloat::ieee::Quad::from_bits(a);
1108                let b = rustc_apfloat::ieee::Quad::from_bits(b);
1109                a.partial_cmp(&b)
1110            }
1111            ty::Int(ity) => {
1112                let size = rustc_abi::Integer::from_int_ty(&tcx, *ity).size();
1113                let a = size.sign_extend(a) as i128;
1114                let b = size.sign_extend(b) as i128;
1115                Some(a.cmp(&b))
1116            }
1117            ty::Uint(_) | ty::Char => Some(a.cmp(&b)),
1118            _ => bug!(),
1119        }
1120    }
1121}
1122
1123// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
1124#[cfg(target_pointer_width = "64")]
1125mod size_asserts {
1126    use rustc_data_structures::static_assert_size;
1127
1128    use super::*;
1129    // tidy-alphabetical-start
1130    const _: [(); 48] = [(); ::std::mem::size_of::<Block>()];static_assert_size!(Block, 48);
1131    const _: [(); 64] = [(); ::std::mem::size_of::<Expr<'_>>()];static_assert_size!(Expr<'_>, 64);
1132    const _: [(); 40] = [(); ::std::mem::size_of::<ExprKind<'_>>()];static_assert_size!(ExprKind<'_>, 40);
1133    const _: [(); 72] = [(); ::std::mem::size_of::<Pat<'_>>()];static_assert_size!(Pat<'_>, 72);
1134    const _: [(); 48] = [(); ::std::mem::size_of::<PatKind<'_>>()];static_assert_size!(PatKind<'_>, 48);
1135    const _: [(); 48] = [(); ::std::mem::size_of::<Stmt<'_>>()];static_assert_size!(Stmt<'_>, 48);
1136    const _: [(); 48] = [(); ::std::mem::size_of::<StmtKind<'_>>()];static_assert_size!(StmtKind<'_>, 48);
1137    // tidy-alphabetical-end
1138}