Skip to main content

rustc_public/mir/
body.rs

1use std::io;
2
3use serde::Serialize;
4
5use crate::compiler_interface::with;
6use crate::mir::pretty::function_body;
7use crate::ty::{
8    AdtDef, ClosureDef, CoroutineClosureDef, CoroutineDef, GenericArgs, MirConst, Movability,
9    Region, RigidTy, Ty, TyConst, TyKind, VariantIdx,
10};
11use crate::{Error, Opaque, Span, Symbol};
12
13/// The rustc_public's IR representation of a single function.
14#[derive(#[automatically_derived]
impl ::core::clone::Clone for Body {
    #[inline]
    fn clone(&self) -> Body {
        Body {
            blocks: ::core::clone::Clone::clone(&self.blocks),
            locals: ::core::clone::Clone::clone(&self.locals),
            arg_count: ::core::clone::Clone::clone(&self.arg_count),
            var_debug_info: ::core::clone::Clone::clone(&self.var_debug_info),
            spread_arg: ::core::clone::Clone::clone(&self.spread_arg),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Body {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            &["blocks", "locals", "arg_count", "var_debug_info", "spread_arg",
                        "span"];
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.blocks, &self.locals, &self.arg_count,
                        &self.var_debug_info, &self.spread_arg, &&self.span];
        ::core::fmt::Formatter::debug_struct_fields_finish(f, "Body", names,
            values)
    }
}Debug, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Body {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer, "Body",
                            false as usize + 1 + 1 + 1 + 1 + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "blocks", &self.blocks)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "locals", &self.locals)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "arg_count", &self.arg_count)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "var_debug_info", &self.var_debug_info)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "spread_arg", &self.spread_arg)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "span", &self.span)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
15pub struct Body {
16    pub blocks: Vec<BasicBlock>,
17
18    /// Declarations of locals within the function.
19    ///
20    /// The first local is the return value pointer, followed by `arg_count`
21    /// locals for the function arguments, followed by any user-declared
22    /// variables and temporaries.
23    pub(super) locals: LocalDecls,
24
25    /// The number of arguments this function takes.
26    pub(super) arg_count: usize,
27
28    /// Debug information pertaining to user variables, including captures.
29    pub var_debug_info: Vec<VarDebugInfo>,
30
31    /// Mark an argument (which must be a tuple) as getting passed as its individual components.
32    ///
33    /// This is used for the "rust-call" ABI such as closures.
34    pub(super) spread_arg: Option<Local>,
35
36    /// The span that covers the entire function body.
37    pub span: Span,
38}
39
40pub type BasicBlockIdx = usize;
41
42impl Body {
43    /// Constructs a `Body`.
44    ///
45    /// A constructor is required to build a `Body` from outside the crate
46    /// because the `arg_count` and `locals` fields are private.
47    pub fn new(
48        blocks: Vec<BasicBlock>,
49        locals: LocalDecls,
50        arg_count: usize,
51        var_debug_info: Vec<VarDebugInfo>,
52        spread_arg: Option<Local>,
53        span: Span,
54    ) -> Self {
55        // If locals doesn't contain enough entries, it can lead to panics in
56        // `ret_local`, `arg_locals`, and `inner_locals`.
57        if !(locals.len() > arg_count) {
    {
        ::core::panicking::panic_fmt(format_args!("A Body must contain at least a local for the return value and each of the function\'s arguments"));
    }
};assert!(
58            locals.len() > arg_count,
59            "A Body must contain at least a local for the return value and each of the function's arguments"
60        );
61        Self { blocks, locals, arg_count, var_debug_info, spread_arg, span }
62    }
63
64    /// Return local that holds this function's return value.
65    pub fn ret_local(&self) -> &LocalDecl {
66        &self.locals[RETURN_LOCAL]
67    }
68
69    /// Locals in `self` that correspond to this function's arguments.
70    pub fn arg_locals(&self) -> &[LocalDecl] {
71        &self.locals[1..][..self.arg_count]
72    }
73
74    /// Inner locals for this function. These are the locals that are
75    /// neither the return local nor the argument locals.
76    pub fn inner_locals(&self) -> &[LocalDecl] {
77        &self.locals[self.arg_count + 1..]
78    }
79
80    /// Returns a mutable reference to the local that holds this function's return value.
81    pub(crate) fn ret_local_mut(&mut self) -> &mut LocalDecl {
82        &mut self.locals[RETURN_LOCAL]
83    }
84
85    /// Returns a mutable slice of locals corresponding to this function's arguments.
86    pub(crate) fn arg_locals_mut(&mut self) -> &mut [LocalDecl] {
87        &mut self.locals[1..][..self.arg_count]
88    }
89
90    /// Returns a mutable slice of inner locals for this function.
91    /// Inner locals are those that are neither the return local nor the argument locals.
92    pub(crate) fn inner_locals_mut(&mut self) -> &mut [LocalDecl] {
93        &mut self.locals[self.arg_count + 1..]
94    }
95
96    /// Convenience function to get all the locals in this function.
97    ///
98    /// Locals are typically accessed via the more specific methods `ret_local`,
99    /// `arg_locals`, and `inner_locals`.
100    pub fn locals(&self) -> &[LocalDecl] {
101        &self.locals
102    }
103
104    /// Get the local declaration for this local.
105    pub fn local_decl(&self, local: Local) -> Option<&LocalDecl> {
106        self.locals.get(local)
107    }
108
109    /// Get an iterator for all local declarations.
110    pub fn local_decls(&self) -> impl Iterator<Item = (Local, &LocalDecl)> {
111        self.locals.iter().enumerate()
112    }
113
114    /// Emit the body using the provided name for the signature.
115    pub fn dump<W: io::Write>(&self, w: &mut W, fn_name: &str) -> io::Result<()> {
116        function_body(w, self, fn_name)
117    }
118
119    pub fn spread_arg(&self) -> Option<Local> {
120        self.spread_arg
121    }
122}
123
124type LocalDecls = Vec<LocalDecl>;
125
126#[derive(#[automatically_derived]
impl ::core::clone::Clone for LocalDecl {
    #[inline]
    fn clone(&self) -> LocalDecl {
        LocalDecl {
            ty: ::core::clone::Clone::clone(&self.ty),
            span: ::core::clone::Clone::clone(&self.span),
            mutability: ::core::clone::Clone::clone(&self.mutability),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for LocalDecl {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "LocalDecl",
            "ty", &self.ty, "span", &self.span, "mutability",
            &&self.mutability)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for LocalDecl {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Ty>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<Mutability>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for LocalDecl {
    #[inline]
    fn eq(&self, other: &LocalDecl) -> bool {
        self.ty == other.ty && self.span == other.span &&
            self.mutability == other.mutability
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for LocalDecl {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "LocalDecl", false as usize + 1 + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "ty", &self.ty)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "span", &self.span)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "mutability", &self.mutability)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
127pub struct LocalDecl {
128    pub ty: Ty,
129    pub span: Span,
130    pub mutability: Mutability,
131}
132
133#[derive(#[automatically_derived]
impl ::core::clone::Clone for BasicBlock {
    #[inline]
    fn clone(&self) -> BasicBlock {
        BasicBlock {
            statements: ::core::clone::Clone::clone(&self.statements),
            terminator: ::core::clone::Clone::clone(&self.terminator),
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for BasicBlock {
    #[inline]
    fn eq(&self, other: &BasicBlock) -> bool {
        self.statements == other.statements &&
            self.terminator == other.terminator
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for BasicBlock {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Vec<Statement>>;
        let _: ::core::cmp::AssertParamIsEq<Terminator>;
    }
}Eq, #[automatically_derived]
impl ::core::fmt::Debug for BasicBlock {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "BasicBlock",
            "statements", &self.statements, "terminator", &&self.terminator)
    }
}Debug, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for BasicBlock {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "BasicBlock", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "statements", &self.statements)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "terminator", &self.terminator)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
134pub struct BasicBlock {
135    pub statements: Vec<Statement>,
136    pub terminator: Terminator,
137}
138
139#[derive(#[automatically_derived]
impl ::core::clone::Clone for Terminator {
    #[inline]
    fn clone(&self) -> Terminator {
        Terminator {
            kind: ::core::clone::Clone::clone(&self.kind),
            source_info: ::core::clone::Clone::clone(&self.source_info),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Terminator {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Terminator",
            "kind", &self.kind, "source_info", &&self.source_info)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Terminator {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<TerminatorKind>;
        let _: ::core::cmp::AssertParamIsEq<SourceInfo>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Terminator {
    #[inline]
    fn eq(&self, other: &Terminator) -> bool {
        self.kind == other.kind && self.source_info == other.source_info
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Terminator {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "Terminator", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "kind", &self.kind)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "source_info", &self.source_info)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
140pub struct Terminator {
141    pub kind: TerminatorKind,
142    pub source_info: SourceInfo,
143}
144
145impl Terminator {
146    pub fn successors(&self) -> Successors {
147        self.kind.successors()
148    }
149}
150
151pub type Successors = Vec<BasicBlockIdx>;
152
153#[derive(#[automatically_derived]
impl ::core::clone::Clone for TerminatorKind {
    #[inline]
    fn clone(&self) -> TerminatorKind {
        match self {
            TerminatorKind::Goto { target: __self_0 } =>
                TerminatorKind::Goto {
                    target: ::core::clone::Clone::clone(__self_0),
                },
            TerminatorKind::SwitchInt { discr: __self_0, targets: __self_1 }
                =>
                TerminatorKind::SwitchInt {
                    discr: ::core::clone::Clone::clone(__self_0),
                    targets: ::core::clone::Clone::clone(__self_1),
                },
            TerminatorKind::Resume => TerminatorKind::Resume,
            TerminatorKind::Abort => TerminatorKind::Abort,
            TerminatorKind::Return => TerminatorKind::Return,
            TerminatorKind::Unreachable => TerminatorKind::Unreachable,
            TerminatorKind::Drop {
                place: __self_0, target: __self_1, unwind: __self_2 } =>
                TerminatorKind::Drop {
                    place: ::core::clone::Clone::clone(__self_0),
                    target: ::core::clone::Clone::clone(__self_1),
                    unwind: ::core::clone::Clone::clone(__self_2),
                },
            TerminatorKind::Call {
                func: __self_0,
                args: __self_1,
                destination: __self_2,
                target: __self_3,
                unwind: __self_4 } =>
                TerminatorKind::Call {
                    func: ::core::clone::Clone::clone(__self_0),
                    args: ::core::clone::Clone::clone(__self_1),
                    destination: ::core::clone::Clone::clone(__self_2),
                    target: ::core::clone::Clone::clone(__self_3),
                    unwind: ::core::clone::Clone::clone(__self_4),
                },
            TerminatorKind::Assert {
                cond: __self_0,
                expected: __self_1,
                msg: __self_2,
                target: __self_3,
                unwind: __self_4 } =>
                TerminatorKind::Assert {
                    cond: ::core::clone::Clone::clone(__self_0),
                    expected: ::core::clone::Clone::clone(__self_1),
                    msg: ::core::clone::Clone::clone(__self_2),
                    target: ::core::clone::Clone::clone(__self_3),
                    unwind: ::core::clone::Clone::clone(__self_4),
                },
            TerminatorKind::InlineAsm {
                template: __self_0,
                operands: __self_1,
                options: __self_2,
                line_spans: __self_3,
                destination: __self_4,
                unwind: __self_5 } =>
                TerminatorKind::InlineAsm {
                    template: ::core::clone::Clone::clone(__self_0),
                    operands: ::core::clone::Clone::clone(__self_1),
                    options: ::core::clone::Clone::clone(__self_2),
                    line_spans: ::core::clone::Clone::clone(__self_3),
                    destination: ::core::clone::Clone::clone(__self_4),
                    unwind: ::core::clone::Clone::clone(__self_5),
                },
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for TerminatorKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            TerminatorKind::Goto { target: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Goto",
                    "target", &__self_0),
            TerminatorKind::SwitchInt { discr: __self_0, targets: __self_1 }
                =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "SwitchInt", "discr", __self_0, "targets", &__self_1),
            TerminatorKind::Resume =>
                ::core::fmt::Formatter::write_str(f, "Resume"),
            TerminatorKind::Abort =>
                ::core::fmt::Formatter::write_str(f, "Abort"),
            TerminatorKind::Return =>
                ::core::fmt::Formatter::write_str(f, "Return"),
            TerminatorKind::Unreachable =>
                ::core::fmt::Formatter::write_str(f, "Unreachable"),
            TerminatorKind::Drop {
                place: __self_0, target: __self_1, unwind: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f, "Drop",
                    "place", __self_0, "target", __self_1, "unwind", &__self_2),
            TerminatorKind::Call {
                func: __self_0,
                args: __self_1,
                destination: __self_2,
                target: __self_3,
                unwind: __self_4 } =>
                ::core::fmt::Formatter::debug_struct_field5_finish(f, "Call",
                    "func", __self_0, "args", __self_1, "destination", __self_2,
                    "target", __self_3, "unwind", &__self_4),
            TerminatorKind::Assert {
                cond: __self_0,
                expected: __self_1,
                msg: __self_2,
                target: __self_3,
                unwind: __self_4 } =>
                ::core::fmt::Formatter::debug_struct_field5_finish(f,
                    "Assert", "cond", __self_0, "expected", __self_1, "msg",
                    __self_2, "target", __self_3, "unwind", &__self_4),
            TerminatorKind::InlineAsm {
                template: __self_0,
                operands: __self_1,
                options: __self_2,
                line_spans: __self_3,
                destination: __self_4,
                unwind: __self_5 } => {
                let names: &'static _ =
                    &["template", "operands", "options", "line_spans",
                                "destination", "unwind"];
                let values: &[&dyn ::core::fmt::Debug] =
                    &[__self_0, __self_1, __self_2, __self_3, __self_4,
                                &__self_5];
                ::core::fmt::Formatter::debug_struct_fields_finish(f,
                    "InlineAsm", names, values)
            }
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for TerminatorKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<BasicBlockIdx>;
        let _: ::core::cmp::AssertParamIsEq<Operand>;
        let _: ::core::cmp::AssertParamIsEq<SwitchTargets>;
        let _: ::core::cmp::AssertParamIsEq<Place>;
        let _: ::core::cmp::AssertParamIsEq<UnwindAction>;
        let _: ::core::cmp::AssertParamIsEq<Vec<Operand>>;
        let _: ::core::cmp::AssertParamIsEq<Option<BasicBlockIdx>>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
        let _: ::core::cmp::AssertParamIsEq<AssertMessage>;
        let _: ::core::cmp::AssertParamIsEq<String>;
        let _: ::core::cmp::AssertParamIsEq<Vec<InlineAsmOperand>>;
        let _: ::core::cmp::AssertParamIsEq<Option<BasicBlockIdx>>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for TerminatorKind {
    #[inline]
    fn eq(&self, other: &TerminatorKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (TerminatorKind::Goto { target: __self_0 },
                    TerminatorKind::Goto { target: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                (TerminatorKind::SwitchInt {
                    discr: __self_0, targets: __self_1 },
                    TerminatorKind::SwitchInt {
                    discr: __arg1_0, targets: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (TerminatorKind::Drop {
                    place: __self_0, target: __self_1, unwind: __self_2 },
                    TerminatorKind::Drop {
                    place: __arg1_0, target: __arg1_1, unwind: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (TerminatorKind::Call {
                    func: __self_0,
                    args: __self_1,
                    destination: __self_2,
                    target: __self_3,
                    unwind: __self_4 }, TerminatorKind::Call {
                    func: __arg1_0,
                    args: __arg1_1,
                    destination: __arg1_2,
                    target: __arg1_3,
                    unwind: __arg1_4 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                                __self_2 == __arg1_2 && __self_3 == __arg1_3 &&
                        __self_4 == __arg1_4,
                (TerminatorKind::Assert {
                    cond: __self_0,
                    expected: __self_1,
                    msg: __self_2,
                    target: __self_3,
                    unwind: __self_4 }, TerminatorKind::Assert {
                    cond: __arg1_0,
                    expected: __arg1_1,
                    msg: __arg1_2,
                    target: __arg1_3,
                    unwind: __arg1_4 }) =>
                    __self_1 == __arg1_1 && __self_0 == __arg1_0 &&
                                __self_2 == __arg1_2 && __self_3 == __arg1_3 &&
                        __self_4 == __arg1_4,
                (TerminatorKind::InlineAsm {
                    template: __self_0,
                    operands: __self_1,
                    options: __self_2,
                    line_spans: __self_3,
                    destination: __self_4,
                    unwind: __self_5 }, TerminatorKind::InlineAsm {
                    template: __arg1_0,
                    operands: __arg1_1,
                    options: __arg1_2,
                    line_spans: __arg1_3,
                    destination: __arg1_4,
                    unwind: __arg1_5 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                                    __self_2 == __arg1_2 && __self_3 == __arg1_3 &&
                            __self_4 == __arg1_4 && __self_5 == __arg1_5,
                _ => true,
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for TerminatorKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    TerminatorKind::Goto { ref target } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "TerminatorKind", 0u32, "Goto", 0 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "target", target)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    TerminatorKind::SwitchInt { ref discr, ref targets } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "TerminatorKind", 1u32, "SwitchInt", 0 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "discr", discr)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "targets", targets)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    TerminatorKind::Resume =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "TerminatorKind", 2u32, "Resume"),
                    TerminatorKind::Abort =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "TerminatorKind", 3u32, "Abort"),
                    TerminatorKind::Return =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "TerminatorKind", 4u32, "Return"),
                    TerminatorKind::Unreachable =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "TerminatorKind", 5u32, "Unreachable"),
                    TerminatorKind::Drop { ref place, ref target, ref unwind }
                        => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "TerminatorKind", 6u32, "Drop", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "place", place)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "target", target)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "unwind", unwind)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    TerminatorKind::Call {
                        ref func, ref args, ref destination, ref target, ref unwind
                        } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "TerminatorKind", 7u32, "Call", 0 + 1 + 1 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "func", func)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "args", args)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "destination", destination)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "target", target)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "unwind", unwind)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    TerminatorKind::Assert {
                        ref cond, ref expected, ref msg, ref target, ref unwind } =>
                        {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "TerminatorKind", 8u32, "Assert", 0 + 1 + 1 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "cond", cond)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "expected", expected)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "msg", msg)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "target", target)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "unwind", unwind)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    TerminatorKind::InlineAsm {
                        ref template,
                        ref operands,
                        ref options,
                        ref line_spans,
                        ref destination,
                        ref unwind } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "TerminatorKind", 9u32, "InlineAsm",
                                    0 + 1 + 1 + 1 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "template", template)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "operands", operands)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "options", options)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "line_spans", line_spans)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "destination", destination)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "unwind", unwind)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                }
            }
        }
    };Serialize)]
154pub enum TerminatorKind {
155    Goto {
156        target: BasicBlockIdx,
157    },
158    SwitchInt {
159        discr: Operand,
160        targets: SwitchTargets,
161    },
162    Resume,
163    Abort,
164    Return,
165    Unreachable,
166    Drop {
167        place: Place,
168        target: BasicBlockIdx,
169        unwind: UnwindAction,
170    },
171    Call {
172        func: Operand,
173        args: Vec<Operand>,
174        destination: Place,
175        target: Option<BasicBlockIdx>,
176        unwind: UnwindAction,
177    },
178    Assert {
179        cond: Operand,
180        expected: bool,
181        msg: AssertMessage,
182        target: BasicBlockIdx,
183        unwind: UnwindAction,
184    },
185    InlineAsm {
186        template: String,
187        operands: Vec<InlineAsmOperand>,
188        options: String,
189        line_spans: String,
190        destination: Option<BasicBlockIdx>,
191        unwind: UnwindAction,
192    },
193}
194
195impl TerminatorKind {
196    pub fn successors(&self) -> Successors {
197        use self::TerminatorKind::*;
198        match *self {
199            Call { target: Some(t), unwind: UnwindAction::Cleanup(u), .. }
200            | Drop { target: t, unwind: UnwindAction::Cleanup(u), .. }
201            | Assert { target: t, unwind: UnwindAction::Cleanup(u), .. }
202            | InlineAsm { destination: Some(t), unwind: UnwindAction::Cleanup(u), .. } => {
203                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
        [t, u]))vec![t, u]
204            }
205            Goto { target: t }
206            | Call { target: None, unwind: UnwindAction::Cleanup(t), .. }
207            | Call { target: Some(t), unwind: _, .. }
208            | Drop { target: t, unwind: _, .. }
209            | Assert { target: t, unwind: _, .. }
210            | InlineAsm { destination: None, unwind: UnwindAction::Cleanup(t), .. }
211            | InlineAsm { destination: Some(t), unwind: _, .. } => {
212                ::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
        [t]))vec![t]
213            }
214
215            Return
216            | Resume
217            | Abort
218            | Unreachable
219            | Call { target: None, unwind: _, .. }
220            | InlineAsm { destination: None, unwind: _, .. } => {
221                ::alloc::vec::Vec::new()vec![]
222            }
223            SwitchInt { ref targets, .. } => targets.all_targets(),
224        }
225    }
226
227    pub fn unwind(&self) -> Option<&UnwindAction> {
228        match *self {
229            TerminatorKind::Goto { .. }
230            | TerminatorKind::Return
231            | TerminatorKind::Unreachable
232            | TerminatorKind::Resume
233            | TerminatorKind::Abort
234            | TerminatorKind::SwitchInt { .. } => None,
235            TerminatorKind::Call { ref unwind, .. }
236            | TerminatorKind::Assert { ref unwind, .. }
237            | TerminatorKind::Drop { ref unwind, .. }
238            | TerminatorKind::InlineAsm { ref unwind, .. } => Some(unwind),
239        }
240    }
241}
242
243#[derive(#[automatically_derived]
impl ::core::clone::Clone for InlineAsmOperand {
    #[inline]
    fn clone(&self) -> InlineAsmOperand {
        InlineAsmOperand {
            in_value: ::core::clone::Clone::clone(&self.in_value),
            out_place: ::core::clone::Clone::clone(&self.out_place),
            raw_rpr: ::core::clone::Clone::clone(&self.raw_rpr),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for InlineAsmOperand {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "InlineAsmOperand", "in_value", &self.in_value, "out_place",
            &self.out_place, "raw_rpr", &&self.raw_rpr)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for InlineAsmOperand {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<Operand>>;
        let _: ::core::cmp::AssertParamIsEq<Option<Place>>;
        let _: ::core::cmp::AssertParamIsEq<String>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for InlineAsmOperand {
    #[inline]
    fn eq(&self, other: &InlineAsmOperand) -> bool {
        self.in_value == other.in_value && self.out_place == other.out_place
            && self.raw_rpr == other.raw_rpr
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for InlineAsmOperand {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "InlineAsmOperand", false as usize + 1 + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "in_value", &self.in_value)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "out_place", &self.out_place)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "raw_rpr", &self.raw_rpr)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
244pub struct InlineAsmOperand {
245    pub in_value: Option<Operand>,
246    pub out_place: Option<Place>,
247    // This field has a raw debug representation of MIR's InlineAsmOperand.
248    // For now we care about place/operand + the rest in a debug format.
249    pub raw_rpr: String,
250}
251
252#[derive(#[automatically_derived]
impl ::core::marker::Copy for UnwindAction { }Copy, #[automatically_derived]
impl ::core::clone::Clone for UnwindAction {
    #[inline]
    fn clone(&self) -> UnwindAction {
        let _: ::core::clone::AssertParamIsClone<BasicBlockIdx>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for UnwindAction {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            UnwindAction::Continue =>
                ::core::fmt::Formatter::write_str(f, "Continue"),
            UnwindAction::Unreachable =>
                ::core::fmt::Formatter::write_str(f, "Unreachable"),
            UnwindAction::Terminate =>
                ::core::fmt::Formatter::write_str(f, "Terminate"),
            UnwindAction::Cleanup(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Cleanup", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for UnwindAction {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<BasicBlockIdx>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for UnwindAction {
    #[inline]
    fn eq(&self, other: &UnwindAction) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (UnwindAction::Cleanup(__self_0),
                    UnwindAction::Cleanup(__arg1_0)) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for UnwindAction {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    UnwindAction::Continue =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "UnwindAction", 0u32, "Continue"),
                    UnwindAction::Unreachable =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "UnwindAction", 1u32, "Unreachable"),
                    UnwindAction::Terminate =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "UnwindAction", 2u32, "Terminate"),
                    UnwindAction::Cleanup(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "UnwindAction", 3u32, "Cleanup", __field0),
                }
            }
        }
    };Serialize)]
253pub enum UnwindAction {
254    Continue,
255    Unreachable,
256    Terminate,
257    Cleanup(BasicBlockIdx),
258}
259
260#[derive(#[automatically_derived]
impl ::core::clone::Clone for AssertMessage {
    #[inline]
    fn clone(&self) -> AssertMessage {
        match self {
            AssertMessage::BoundsCheck { len: __self_0, index: __self_1 } =>
                AssertMessage::BoundsCheck {
                    len: ::core::clone::Clone::clone(__self_0),
                    index: ::core::clone::Clone::clone(__self_1),
                },
            AssertMessage::Overflow(__self_0, __self_1, __self_2) =>
                AssertMessage::Overflow(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            AssertMessage::OverflowNeg(__self_0) =>
                AssertMessage::OverflowNeg(::core::clone::Clone::clone(__self_0)),
            AssertMessage::DivisionByZero(__self_0) =>
                AssertMessage::DivisionByZero(::core::clone::Clone::clone(__self_0)),
            AssertMessage::RemainderByZero(__self_0) =>
                AssertMessage::RemainderByZero(::core::clone::Clone::clone(__self_0)),
            AssertMessage::ResumedAfterReturn(__self_0) =>
                AssertMessage::ResumedAfterReturn(::core::clone::Clone::clone(__self_0)),
            AssertMessage::ResumedAfterPanic(__self_0) =>
                AssertMessage::ResumedAfterPanic(::core::clone::Clone::clone(__self_0)),
            AssertMessage::ResumedAfterDrop(__self_0) =>
                AssertMessage::ResumedAfterDrop(::core::clone::Clone::clone(__self_0)),
            AssertMessage::MisalignedPointerDereference {
                required: __self_0, found: __self_1 } =>
                AssertMessage::MisalignedPointerDereference {
                    required: ::core::clone::Clone::clone(__self_0),
                    found: ::core::clone::Clone::clone(__self_1),
                },
            AssertMessage::NullPointerDereference =>
                AssertMessage::NullPointerDereference,
            AssertMessage::NullReferenceConstructed =>
                AssertMessage::NullReferenceConstructed,
            AssertMessage::InvalidEnumConstruction(__self_0) =>
                AssertMessage::InvalidEnumConstruction(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for AssertMessage {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            AssertMessage::BoundsCheck { len: __self_0, index: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "BoundsCheck", "len", __self_0, "index", &__self_1),
            AssertMessage::Overflow(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f,
                    "Overflow", __self_0, __self_1, &__self_2),
            AssertMessage::OverflowNeg(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "OverflowNeg", &__self_0),
            AssertMessage::DivisionByZero(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DivisionByZero", &__self_0),
            AssertMessage::RemainderByZero(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "RemainderByZero", &__self_0),
            AssertMessage::ResumedAfterReturn(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ResumedAfterReturn", &__self_0),
            AssertMessage::ResumedAfterPanic(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ResumedAfterPanic", &__self_0),
            AssertMessage::ResumedAfterDrop(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ResumedAfterDrop", &__self_0),
            AssertMessage::MisalignedPointerDereference {
                required: __self_0, found: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "MisalignedPointerDereference", "required", __self_0,
                    "found", &__self_1),
            AssertMessage::NullPointerDereference =>
                ::core::fmt::Formatter::write_str(f,
                    "NullPointerDereference"),
            AssertMessage::NullReferenceConstructed =>
                ::core::fmt::Formatter::write_str(f,
                    "NullReferenceConstructed"),
            AssertMessage::InvalidEnumConstruction(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "InvalidEnumConstruction", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for AssertMessage {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Operand>;
        let _: ::core::cmp::AssertParamIsEq<BinOp>;
        let _: ::core::cmp::AssertParamIsEq<CoroutineKind>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for AssertMessage {
    #[inline]
    fn eq(&self, other: &AssertMessage) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (AssertMessage::BoundsCheck { len: __self_0, index: __self_1
                    }, AssertMessage::BoundsCheck {
                    len: __arg1_0, index: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (AssertMessage::Overflow(__self_0, __self_1, __self_2),
                    AssertMessage::Overflow(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (AssertMessage::OverflowNeg(__self_0),
                    AssertMessage::OverflowNeg(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AssertMessage::DivisionByZero(__self_0),
                    AssertMessage::DivisionByZero(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AssertMessage::RemainderByZero(__self_0),
                    AssertMessage::RemainderByZero(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AssertMessage::ResumedAfterReturn(__self_0),
                    AssertMessage::ResumedAfterReturn(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AssertMessage::ResumedAfterPanic(__self_0),
                    AssertMessage::ResumedAfterPanic(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AssertMessage::ResumedAfterDrop(__self_0),
                    AssertMessage::ResumedAfterDrop(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (AssertMessage::MisalignedPointerDereference {
                    required: __self_0, found: __self_1 },
                    AssertMessage::MisalignedPointerDereference {
                    required: __arg1_0, found: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (AssertMessage::InvalidEnumConstruction(__self_0),
                    AssertMessage::InvalidEnumConstruction(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for AssertMessage {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    AssertMessage::BoundsCheck { ref len, ref index } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "AssertMessage", 0u32, "BoundsCheck", 0 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "len", len)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "index", index)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    AssertMessage::Overflow(ref __field0, ref __field1,
                        ref __field2) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "AssertMessage", 1u32, "Overflow", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    AssertMessage::OverflowNeg(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 2u32, "OverflowNeg", __field0),
                    AssertMessage::DivisionByZero(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 3u32, "DivisionByZero", __field0),
                    AssertMessage::RemainderByZero(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 4u32, "RemainderByZero", __field0),
                    AssertMessage::ResumedAfterReturn(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 5u32, "ResumedAfterReturn", __field0),
                    AssertMessage::ResumedAfterPanic(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 6u32, "ResumedAfterPanic", __field0),
                    AssertMessage::ResumedAfterDrop(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 7u32, "ResumedAfterDrop", __field0),
                    AssertMessage::MisalignedPointerDereference {
                        ref required, ref found } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "AssertMessage", 8u32, "MisalignedPointerDereference",
                                    0 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "required", required)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "found", found)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    AssertMessage::NullPointerDereference =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "AssertMessage", 9u32, "NullPointerDereference"),
                    AssertMessage::NullReferenceConstructed =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "AssertMessage", 10u32, "NullReferenceConstructed"),
                    AssertMessage::InvalidEnumConstruction(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 11u32, "InvalidEnumConstruction",
                            __field0),
                }
            }
        }
    };Serialize)]
261pub enum AssertMessage {
262    BoundsCheck { len: Operand, index: Operand },
263    Overflow(BinOp, Operand, Operand),
264    OverflowNeg(Operand),
265    DivisionByZero(Operand),
266    RemainderByZero(Operand),
267    ResumedAfterReturn(CoroutineKind),
268    ResumedAfterPanic(CoroutineKind),
269    ResumedAfterDrop(CoroutineKind),
270    MisalignedPointerDereference { required: Operand, found: Operand },
271    NullPointerDereference,
272    NullReferenceConstructed,
273    InvalidEnumConstruction(Operand),
274}
275
276impl AssertMessage {
277    pub fn description(&self) -> Result<&'static str, Error> {
278        match self {
279            AssertMessage::Overflow(BinOp::Add, _, _) => Ok("attempt to add with overflow"),
280            AssertMessage::Overflow(BinOp::Sub, _, _) => Ok("attempt to subtract with overflow"),
281            AssertMessage::Overflow(BinOp::Mul, _, _) => Ok("attempt to multiply with overflow"),
282            AssertMessage::Overflow(BinOp::Div, _, _) => Ok("attempt to divide with overflow"),
283            AssertMessage::Overflow(BinOp::Rem, _, _) => {
284                Ok("attempt to calculate the remainder with overflow")
285            }
286            AssertMessage::OverflowNeg(_) => Ok("attempt to negate with overflow"),
287            AssertMessage::Overflow(BinOp::Shr, _, _) => Ok("attempt to shift right with overflow"),
288            AssertMessage::Overflow(BinOp::Shl, _, _) => Ok("attempt to shift left with overflow"),
289            AssertMessage::Overflow(op, _, _) => Err(Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("`{0:?}` cannot overflow", op))
        }))error!("`{:?}` cannot overflow", op)),
290            AssertMessage::DivisionByZero(_) => Ok("attempt to divide by zero"),
291            AssertMessage::RemainderByZero(_) => {
292                Ok("attempt to calculate the remainder with a divisor of zero")
293            }
294            AssertMessage::ResumedAfterReturn(CoroutineKind::Coroutine(_)) => {
295                Ok("coroutine resumed after completion")
296            }
297            AssertMessage::ResumedAfterReturn(CoroutineKind::Desugared(
298                CoroutineDesugaring::Async,
299                _,
300            )) => Ok("`async fn` resumed after completion"),
301            AssertMessage::ResumedAfterReturn(CoroutineKind::Desugared(
302                CoroutineDesugaring::Gen,
303                _,
304            )) => Ok("`async gen fn` resumed after completion"),
305            AssertMessage::ResumedAfterReturn(CoroutineKind::Desugared(
306                CoroutineDesugaring::AsyncGen,
307                _,
308            )) => Ok("`gen fn` should just keep returning `AssertMessage::None` after completion"),
309            AssertMessage::ResumedAfterPanic(CoroutineKind::Coroutine(_)) => {
310                Ok("coroutine resumed after panicking")
311            }
312            AssertMessage::ResumedAfterPanic(CoroutineKind::Desugared(
313                CoroutineDesugaring::Async,
314                _,
315            )) => Ok("`async fn` resumed after panicking"),
316            AssertMessage::ResumedAfterPanic(CoroutineKind::Desugared(
317                CoroutineDesugaring::Gen,
318                _,
319            )) => Ok("`async gen fn` resumed after panicking"),
320            AssertMessage::ResumedAfterPanic(CoroutineKind::Desugared(
321                CoroutineDesugaring::AsyncGen,
322                _,
323            )) => Ok("`gen fn` should just keep returning `AssertMessage::None` after panicking"),
324
325            AssertMessage::ResumedAfterDrop(CoroutineKind::Coroutine(_)) => {
326                Ok("coroutine resumed after async drop")
327            }
328            AssertMessage::ResumedAfterDrop(CoroutineKind::Desugared(
329                CoroutineDesugaring::Async,
330                _,
331            )) => Ok("`async fn` resumed after async drop"),
332            AssertMessage::ResumedAfterDrop(CoroutineKind::Desugared(
333                CoroutineDesugaring::Gen,
334                _,
335            )) => Ok("`async gen fn` resumed after async drop"),
336            AssertMessage::ResumedAfterDrop(CoroutineKind::Desugared(
337                CoroutineDesugaring::AsyncGen,
338                _,
339            )) => Ok("`gen fn` should just keep returning `AssertMessage::None` after async drop"),
340
341            AssertMessage::BoundsCheck { .. } => Ok("index out of bounds"),
342            AssertMessage::MisalignedPointerDereference { .. } => {
343                Ok("misaligned pointer dereference")
344            }
345            AssertMessage::NullPointerDereference => Ok("null pointer dereference occurred"),
346            AssertMessage::NullReferenceConstructed => Ok("null reference produced"),
347            AssertMessage::InvalidEnumConstruction(_) => {
348                Ok("trying to construct an enum from an invalid value")
349            }
350        }
351    }
352}
353
354#[derive(#[automatically_derived]
impl ::core::marker::Copy for BinOp { }Copy, #[automatically_derived]
impl ::core::clone::Clone for BinOp {
    #[inline]
    fn clone(&self) -> BinOp { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for BinOp {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                BinOp::Add => "Add",
                BinOp::AddUnchecked => "AddUnchecked",
                BinOp::Sub => "Sub",
                BinOp::SubUnchecked => "SubUnchecked",
                BinOp::Mul => "Mul",
                BinOp::MulUnchecked => "MulUnchecked",
                BinOp::Div => "Div",
                BinOp::Rem => "Rem",
                BinOp::BitXor => "BitXor",
                BinOp::BitAnd => "BitAnd",
                BinOp::BitOr => "BitOr",
                BinOp::Shl => "Shl",
                BinOp::ShlUnchecked => "ShlUnchecked",
                BinOp::Shr => "Shr",
                BinOp::ShrUnchecked => "ShrUnchecked",
                BinOp::Eq => "Eq",
                BinOp::Lt => "Lt",
                BinOp::Le => "Le",
                BinOp::Ne => "Ne",
                BinOp::Ge => "Ge",
                BinOp::Gt => "Gt",
                BinOp::Cmp => "Cmp",
                BinOp::Offset => "Offset",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for BinOp {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for BinOp {
    #[inline]
    fn eq(&self, other: &BinOp) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for BinOp {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for BinOp {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    BinOp::Add =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 0u32, "Add"),
                    BinOp::AddUnchecked =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 1u32, "AddUnchecked"),
                    BinOp::Sub =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 2u32, "Sub"),
                    BinOp::SubUnchecked =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 3u32, "SubUnchecked"),
                    BinOp::Mul =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 4u32, "Mul"),
                    BinOp::MulUnchecked =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 5u32, "MulUnchecked"),
                    BinOp::Div =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 6u32, "Div"),
                    BinOp::Rem =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 7u32, "Rem"),
                    BinOp::BitXor =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 8u32, "BitXor"),
                    BinOp::BitAnd =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 9u32, "BitAnd"),
                    BinOp::BitOr =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 10u32, "BitOr"),
                    BinOp::Shl =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 11u32, "Shl"),
                    BinOp::ShlUnchecked =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 12u32, "ShlUnchecked"),
                    BinOp::Shr =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 13u32, "Shr"),
                    BinOp::ShrUnchecked =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 14u32, "ShrUnchecked"),
                    BinOp::Eq =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 15u32, "Eq"),
                    BinOp::Lt =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 16u32, "Lt"),
                    BinOp::Le =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 17u32, "Le"),
                    BinOp::Ne =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 18u32, "Ne"),
                    BinOp::Ge =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 19u32, "Ge"),
                    BinOp::Gt =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 20u32, "Gt"),
                    BinOp::Cmp =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 21u32, "Cmp"),
                    BinOp::Offset =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BinOp", 22u32, "Offset"),
                }
            }
        }
    };Serialize)]
355pub enum BinOp {
356    Add,
357    AddUnchecked,
358    Sub,
359    SubUnchecked,
360    Mul,
361    MulUnchecked,
362    Div,
363    Rem,
364    BitXor,
365    BitAnd,
366    BitOr,
367    Shl,
368    ShlUnchecked,
369    Shr,
370    ShrUnchecked,
371    Eq,
372    Lt,
373    Le,
374    Ne,
375    Ge,
376    Gt,
377    Cmp,
378    Offset,
379}
380
381impl BinOp {
382    /// Return the type of this operation for the given input Ty.
383    /// This function does not perform type checking, and it currently doesn't handle SIMD.
384    pub fn ty(&self, lhs_ty: Ty, rhs_ty: Ty) -> Ty {
385        with(|ctx| ctx.binop_ty(*self, lhs_ty, rhs_ty))
386    }
387}
388
389#[derive(#[automatically_derived]
impl ::core::marker::Copy for UnOp { }Copy, #[automatically_derived]
impl ::core::clone::Clone for UnOp {
    #[inline]
    fn clone(&self) -> UnOp { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for UnOp {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                UnOp::Not => "Not",
                UnOp::Neg => "Neg",
                UnOp::PtrMetadata => "PtrMetadata",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for UnOp {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for UnOp {
    #[inline]
    fn eq(&self, other: &UnOp) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for UnOp {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for UnOp {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    UnOp::Not =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "UnOp", 0u32, "Not"),
                    UnOp::Neg =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "UnOp", 1u32, "Neg"),
                    UnOp::PtrMetadata =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "UnOp", 2u32, "PtrMetadata"),
                }
            }
        }
    };Serialize)]
390pub enum UnOp {
391    Not,
392    Neg,
393    PtrMetadata,
394}
395
396impl UnOp {
397    /// Return the type of this operation for the given input Ty.
398    /// This function does not perform type checking, and it currently doesn't handle SIMD.
399    pub fn ty(&self, arg_ty: Ty) -> Ty {
400        with(|ctx| ctx.unop_ty(*self, arg_ty))
401    }
402}
403
404#[derive(#[automatically_derived]
impl ::core::clone::Clone for CoroutineKind {
    #[inline]
    fn clone(&self) -> CoroutineKind {
        match self {
            CoroutineKind::Desugared(__self_0, __self_1) =>
                CoroutineKind::Desugared(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            CoroutineKind::Coroutine(__self_0) =>
                CoroutineKind::Coroutine(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for CoroutineKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            CoroutineKind::Desugared(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "Desugared", __self_0, &__self_1),
            CoroutineKind::Coroutine(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Coroutine", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for CoroutineKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<CoroutineDesugaring>;
        let _: ::core::cmp::AssertParamIsEq<CoroutineSource>;
        let _: ::core::cmp::AssertParamIsEq<Movability>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for CoroutineKind {
    #[inline]
    fn eq(&self, other: &CoroutineKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CoroutineKind::Desugared(__self_0, __self_1),
                    CoroutineKind::Desugared(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (CoroutineKind::Coroutine(__self_0),
                    CoroutineKind::Coroutine(__arg1_0)) => __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for CoroutineKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    CoroutineKind::Desugared(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "CoroutineKind", 0u32, "Desugared", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    CoroutineKind::Coroutine(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "CoroutineKind", 1u32, "Coroutine", __field0),
                }
            }
        }
    };Serialize)]
405pub enum CoroutineKind {
406    Desugared(CoroutineDesugaring, CoroutineSource),
407    Coroutine(Movability),
408}
409
410#[derive(#[automatically_derived]
impl ::core::marker::Copy for CoroutineSource { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CoroutineSource {
    #[inline]
    fn clone(&self) -> CoroutineSource { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for CoroutineSource {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                CoroutineSource::Block => "Block",
                CoroutineSource::Closure => "Closure",
                CoroutineSource::Fn => "Fn",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for CoroutineSource {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for CoroutineSource {
    #[inline]
    fn eq(&self, other: &CoroutineSource) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for CoroutineSource {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    CoroutineSource::Block =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CoroutineSource", 0u32, "Block"),
                    CoroutineSource::Closure =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CoroutineSource", 1u32, "Closure"),
                    CoroutineSource::Fn =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CoroutineSource", 2u32, "Fn"),
                }
            }
        }
    };Serialize)]
411pub enum CoroutineSource {
412    Block,
413    Closure,
414    Fn,
415}
416
417#[derive(#[automatically_derived]
impl ::core::marker::Copy for CoroutineDesugaring { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CoroutineDesugaring {
    #[inline]
    fn clone(&self) -> CoroutineDesugaring { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for CoroutineDesugaring {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                CoroutineDesugaring::Async => "Async",
                CoroutineDesugaring::Gen => "Gen",
                CoroutineDesugaring::AsyncGen => "AsyncGen",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for CoroutineDesugaring {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for CoroutineDesugaring {
    #[inline]
    fn eq(&self, other: &CoroutineDesugaring) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for CoroutineDesugaring {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    CoroutineDesugaring::Async =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CoroutineDesugaring", 0u32, "Async"),
                    CoroutineDesugaring::Gen =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CoroutineDesugaring", 1u32, "Gen"),
                    CoroutineDesugaring::AsyncGen =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CoroutineDesugaring", 2u32, "AsyncGen"),
                }
            }
        }
    };Serialize)]
418pub enum CoroutineDesugaring {
419    Async,
420
421    Gen,
422
423    AsyncGen,
424}
425
426pub(crate) type LocalDefId = Opaque;
427/// The rustc coverage data structures are heavily tied to internal details of the
428/// coverage implementation that are likely to change, and are unlikely to be
429/// useful to third-party tools for the foreseeable future.
430pub(crate) type Coverage = Opaque;
431
432/// The FakeReadCause describes the type of pattern why a FakeRead statement exists.
433#[derive(#[automatically_derived]
impl ::core::clone::Clone for FakeReadCause {
    #[inline]
    fn clone(&self) -> FakeReadCause {
        match self {
            FakeReadCause::ForMatchGuard => FakeReadCause::ForMatchGuard,
            FakeReadCause::ForMatchedPlace(__self_0) =>
                FakeReadCause::ForMatchedPlace(::core::clone::Clone::clone(__self_0)),
            FakeReadCause::ForGuardBinding => FakeReadCause::ForGuardBinding,
            FakeReadCause::ForLet(__self_0) =>
                FakeReadCause::ForLet(::core::clone::Clone::clone(__self_0)),
            FakeReadCause::ForIndex => FakeReadCause::ForIndex,
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for FakeReadCause {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            FakeReadCause::ForMatchGuard =>
                ::core::fmt::Formatter::write_str(f, "ForMatchGuard"),
            FakeReadCause::ForMatchedPlace(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ForMatchedPlace", &__self_0),
            FakeReadCause::ForGuardBinding =>
                ::core::fmt::Formatter::write_str(f, "ForGuardBinding"),
            FakeReadCause::ForLet(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "ForLet",
                    &__self_0),
            FakeReadCause::ForIndex =>
                ::core::fmt::Formatter::write_str(f, "ForIndex"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for FakeReadCause {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for FakeReadCause {
    #[inline]
    fn eq(&self, other: &FakeReadCause) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (FakeReadCause::ForMatchedPlace(__self_0),
                    FakeReadCause::ForMatchedPlace(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (FakeReadCause::ForLet(__self_0),
                    FakeReadCause::ForLet(__arg1_0)) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for FakeReadCause {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    FakeReadCause::ForMatchGuard =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "FakeReadCause", 0u32, "ForMatchGuard"),
                    FakeReadCause::ForMatchedPlace(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "FakeReadCause", 1u32, "ForMatchedPlace", __field0),
                    FakeReadCause::ForGuardBinding =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "FakeReadCause", 2u32, "ForGuardBinding"),
                    FakeReadCause::ForLet(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "FakeReadCause", 3u32, "ForLet", __field0),
                    FakeReadCause::ForIndex =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "FakeReadCause", 4u32, "ForIndex"),
                }
            }
        }
    };Serialize)]
434pub enum FakeReadCause {
435    ForMatchGuard,
436    ForMatchedPlace(LocalDefId),
437    ForGuardBinding,
438    ForLet(LocalDefId),
439    ForIndex,
440}
441
442/// Describes what kind of retag is to be performed
443#[derive(#[automatically_derived]
impl ::core::marker::Copy for WithRetag { }Copy, #[automatically_derived]
impl ::core::clone::Clone for WithRetag {
    #[inline]
    fn clone(&self) -> WithRetag { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for WithRetag {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self { WithRetag::Yes => "Yes", WithRetag::No => "No", })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for WithRetag {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for WithRetag {
    #[inline]
    fn eq(&self, other: &WithRetag) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for WithRetag {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for WithRetag {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    WithRetag::Yes =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "WithRetag", 0u32, "Yes"),
                    WithRetag::No =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "WithRetag", 1u32, "No"),
                }
            }
        }
    };Serialize)]
444pub enum WithRetag {
445    Yes,
446    No,
447}
448
449#[derive(#[automatically_derived]
impl ::core::marker::Copy for Variance { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Variance {
    #[inline]
    fn clone(&self) -> Variance { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Variance {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                Variance::Covariant => "Covariant",
                Variance::Invariant => "Invariant",
                Variance::Contravariant => "Contravariant",
                Variance::Bivariant => "Bivariant",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Variance {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Variance {
    #[inline]
    fn eq(&self, other: &Variance) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for Variance {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Variance {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    Variance::Covariant =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Variance", 0u32, "Covariant"),
                    Variance::Invariant =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Variance", 1u32, "Invariant"),
                    Variance::Contravariant =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Variance", 2u32, "Contravariant"),
                    Variance::Bivariant =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Variance", 3u32, "Bivariant"),
                }
            }
        }
    };Serialize)]
450pub enum Variance {
451    Covariant,
452    Invariant,
453    Contravariant,
454    Bivariant,
455}
456
457#[derive(#[automatically_derived]
impl ::core::clone::Clone for CopyNonOverlapping {
    #[inline]
    fn clone(&self) -> CopyNonOverlapping {
        CopyNonOverlapping {
            src: ::core::clone::Clone::clone(&self.src),
            dst: ::core::clone::Clone::clone(&self.dst),
            count: ::core::clone::Clone::clone(&self.count),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for CopyNonOverlapping {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "CopyNonOverlapping", "src", &self.src, "dst", &self.dst, "count",
            &&self.count)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for CopyNonOverlapping {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Operand>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for CopyNonOverlapping {
    #[inline]
    fn eq(&self, other: &CopyNonOverlapping) -> bool {
        self.src == other.src && self.dst == other.dst &&
            self.count == other.count
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for CopyNonOverlapping {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "CopyNonOverlapping", false as usize + 1 + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "src", &self.src)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "dst", &self.dst)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "count", &self.count)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
458pub struct CopyNonOverlapping {
459    pub src: Operand,
460    pub dst: Operand,
461    pub count: Operand,
462}
463
464#[derive(#[automatically_derived]
impl ::core::clone::Clone for NonDivergingIntrinsic {
    #[inline]
    fn clone(&self) -> NonDivergingIntrinsic {
        match self {
            NonDivergingIntrinsic::Assume(__self_0) =>
                NonDivergingIntrinsic::Assume(::core::clone::Clone::clone(__self_0)),
            NonDivergingIntrinsic::CopyNonOverlapping(__self_0) =>
                NonDivergingIntrinsic::CopyNonOverlapping(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for NonDivergingIntrinsic {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            NonDivergingIntrinsic::Assume(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Assume",
                    &__self_0),
            NonDivergingIntrinsic::CopyNonOverlapping(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CopyNonOverlapping", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for NonDivergingIntrinsic {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Operand>;
        let _: ::core::cmp::AssertParamIsEq<CopyNonOverlapping>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for NonDivergingIntrinsic {
    #[inline]
    fn eq(&self, other: &NonDivergingIntrinsic) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (NonDivergingIntrinsic::Assume(__self_0),
                    NonDivergingIntrinsic::Assume(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (NonDivergingIntrinsic::CopyNonOverlapping(__self_0),
                    NonDivergingIntrinsic::CopyNonOverlapping(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for NonDivergingIntrinsic {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    NonDivergingIntrinsic::Assume(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "NonDivergingIntrinsic", 0u32, "Assume", __field0),
                    NonDivergingIntrinsic::CopyNonOverlapping(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "NonDivergingIntrinsic", 1u32, "CopyNonOverlapping",
                            __field0),
                }
            }
        }
    };Serialize)]
465pub enum NonDivergingIntrinsic {
466    Assume(Operand),
467    CopyNonOverlapping(CopyNonOverlapping),
468}
469
470#[derive(#[automatically_derived]
impl ::core::clone::Clone for Statement {
    #[inline]
    fn clone(&self) -> Statement {
        Statement {
            kind: ::core::clone::Clone::clone(&self.kind),
            source_info: ::core::clone::Clone::clone(&self.source_info),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Statement {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Statement",
            "kind", &self.kind, "source_info", &&self.source_info)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Statement {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<StatementKind>;
        let _: ::core::cmp::AssertParamIsEq<SourceInfo>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Statement {
    #[inline]
    fn eq(&self, other: &Statement) -> bool {
        self.kind == other.kind && self.source_info == other.source_info
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Statement {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "Statement", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "kind", &self.kind)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "source_info", &self.source_info)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
471pub struct Statement {
472    pub kind: StatementKind,
473    pub source_info: SourceInfo,
474}
475
476#[derive(#[automatically_derived]
impl ::core::clone::Clone for StatementKind {
    #[inline]
    fn clone(&self) -> StatementKind {
        match self {
            StatementKind::Assign(__self_0, __self_1) =>
                StatementKind::Assign(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            StatementKind::FakeRead(__self_0, __self_1) =>
                StatementKind::FakeRead(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            StatementKind::SetDiscriminant {
                place: __self_0, variant_index: __self_1 } =>
                StatementKind::SetDiscriminant {
                    place: ::core::clone::Clone::clone(__self_0),
                    variant_index: ::core::clone::Clone::clone(__self_1),
                },
            StatementKind::StorageLive(__self_0) =>
                StatementKind::StorageLive(::core::clone::Clone::clone(__self_0)),
            StatementKind::StorageDead(__self_0) =>
                StatementKind::StorageDead(::core::clone::Clone::clone(__self_0)),
            StatementKind::PlaceMention(__self_0) =>
                StatementKind::PlaceMention(::core::clone::Clone::clone(__self_0)),
            StatementKind::AscribeUserType {
                place: __self_0, projections: __self_1, variance: __self_2 }
                =>
                StatementKind::AscribeUserType {
                    place: ::core::clone::Clone::clone(__self_0),
                    projections: ::core::clone::Clone::clone(__self_1),
                    variance: ::core::clone::Clone::clone(__self_2),
                },
            StatementKind::Coverage(__self_0) =>
                StatementKind::Coverage(::core::clone::Clone::clone(__self_0)),
            StatementKind::Intrinsic(__self_0) =>
                StatementKind::Intrinsic(::core::clone::Clone::clone(__self_0)),
            StatementKind::ConstEvalCounter =>
                StatementKind::ConstEvalCounter,
            StatementKind::Nop => StatementKind::Nop,
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for StatementKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            StatementKind::Assign(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Assign",
                    __self_0, &__self_1),
            StatementKind::FakeRead(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "FakeRead", __self_0, &__self_1),
            StatementKind::SetDiscriminant {
                place: __self_0, variant_index: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "SetDiscriminant", "place", __self_0, "variant_index",
                    &__self_1),
            StatementKind::StorageLive(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "StorageLive", &__self_0),
            StatementKind::StorageDead(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "StorageDead", &__self_0),
            StatementKind::PlaceMention(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "PlaceMention", &__self_0),
            StatementKind::AscribeUserType {
                place: __self_0, projections: __self_1, variance: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "AscribeUserType", "place", __self_0, "projections",
                    __self_1, "variance", &__self_2),
            StatementKind::Coverage(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Coverage", &__self_0),
            StatementKind::Intrinsic(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Intrinsic", &__self_0),
            StatementKind::ConstEvalCounter =>
                ::core::fmt::Formatter::write_str(f, "ConstEvalCounter"),
            StatementKind::Nop => ::core::fmt::Formatter::write_str(f, "Nop"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for StatementKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Place>;
        let _: ::core::cmp::AssertParamIsEq<Rvalue>;
        let _: ::core::cmp::AssertParamIsEq<FakeReadCause>;
        let _: ::core::cmp::AssertParamIsEq<VariantIdx>;
        let _: ::core::cmp::AssertParamIsEq<Local>;
        let _: ::core::cmp::AssertParamIsEq<UserTypeProjection>;
        let _: ::core::cmp::AssertParamIsEq<Variance>;
        let _: ::core::cmp::AssertParamIsEq<Coverage>;
        let _: ::core::cmp::AssertParamIsEq<NonDivergingIntrinsic>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for StatementKind {
    #[inline]
    fn eq(&self, other: &StatementKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (StatementKind::Assign(__self_0, __self_1),
                    StatementKind::Assign(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (StatementKind::FakeRead(__self_0, __self_1),
                    StatementKind::FakeRead(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (StatementKind::SetDiscriminant {
                    place: __self_0, variant_index: __self_1 },
                    StatementKind::SetDiscriminant {
                    place: __arg1_0, variant_index: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (StatementKind::StorageLive(__self_0),
                    StatementKind::StorageLive(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (StatementKind::StorageDead(__self_0),
                    StatementKind::StorageDead(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (StatementKind::PlaceMention(__self_0),
                    StatementKind::PlaceMention(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (StatementKind::AscribeUserType {
                    place: __self_0, projections: __self_1, variance: __self_2
                    }, StatementKind::AscribeUserType {
                    place: __arg1_0, projections: __arg1_1, variance: __arg1_2
                    }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (StatementKind::Coverage(__self_0),
                    StatementKind::Coverage(__arg1_0)) => __self_0 == __arg1_0,
                (StatementKind::Intrinsic(__self_0),
                    StatementKind::Intrinsic(__arg1_0)) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for StatementKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    StatementKind::Assign(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "StatementKind", 0u32, "Assign", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    StatementKind::FakeRead(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "StatementKind", 1u32, "FakeRead", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    StatementKind::SetDiscriminant {
                        ref place, ref variant_index } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "StatementKind", 2u32, "SetDiscriminant", 0 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "place", place)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "variant_index", variant_index)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    StatementKind::StorageLive(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 3u32, "StorageLive", __field0),
                    StatementKind::StorageDead(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 4u32, "StorageDead", __field0),
                    StatementKind::PlaceMention(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 5u32, "PlaceMention", __field0),
                    StatementKind::AscribeUserType {
                        ref place, ref projections, ref variance } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "StatementKind", 6u32, "AscribeUserType", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "place", place)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "projections", projections)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "variance", variance)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    StatementKind::Coverage(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 7u32, "Coverage", __field0),
                    StatementKind::Intrinsic(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 8u32, "Intrinsic", __field0),
                    StatementKind::ConstEvalCounter =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "StatementKind", 9u32, "ConstEvalCounter"),
                    StatementKind::Nop =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "StatementKind", 10u32, "Nop"),
                }
            }
        }
    };Serialize)]
477pub enum StatementKind {
478    Assign(Place, Rvalue),
479    FakeRead(FakeReadCause, Place),
480    SetDiscriminant { place: Place, variant_index: VariantIdx },
481    StorageLive(Local),
482    StorageDead(Local),
483    PlaceMention(Place),
484    AscribeUserType { place: Place, projections: UserTypeProjection, variance: Variance },
485    Coverage(Coverage),
486    Intrinsic(NonDivergingIntrinsic),
487    ConstEvalCounter,
488    Nop,
489}
490
491#[derive(#[automatically_derived]
impl ::core::clone::Clone for Rvalue {
    #[inline]
    fn clone(&self) -> Rvalue {
        match self {
            Rvalue::AddressOf(__self_0, __self_1) =>
                Rvalue::AddressOf(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Rvalue::Aggregate(__self_0, __self_1) =>
                Rvalue::Aggregate(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Rvalue::BinaryOp(__self_0, __self_1, __self_2) =>
                Rvalue::BinaryOp(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Rvalue::Cast(__self_0, __self_1, __self_2) =>
                Rvalue::Cast(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Rvalue::CheckedBinaryOp(__self_0, __self_1, __self_2) =>
                Rvalue::CheckedBinaryOp(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Rvalue::CopyForDeref(__self_0) =>
                Rvalue::CopyForDeref(::core::clone::Clone::clone(__self_0)),
            Rvalue::Discriminant(__self_0) =>
                Rvalue::Discriminant(::core::clone::Clone::clone(__self_0)),
            Rvalue::Len(__self_0) =>
                Rvalue::Len(::core::clone::Clone::clone(__self_0)),
            Rvalue::Ref(__self_0, __self_1, __self_2) =>
                Rvalue::Ref(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Rvalue::Repeat(__self_0, __self_1) =>
                Rvalue::Repeat(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Rvalue::ThreadLocalRef(__self_0) =>
                Rvalue::ThreadLocalRef(::core::clone::Clone::clone(__self_0)),
            Rvalue::UnaryOp(__self_0, __self_1) =>
                Rvalue::UnaryOp(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Rvalue::Use(__self_0, __self_1) =>
                Rvalue::Use(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Rvalue::Reborrow(__self_0, __self_1, __self_2) =>
                Rvalue::Reborrow(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Rvalue {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Rvalue::AddressOf(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "AddressOf", __self_0, &__self_1),
            Rvalue::Aggregate(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "Aggregate", __self_0, &__self_1),
            Rvalue::BinaryOp(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f,
                    "BinaryOp", __self_0, __self_1, &__self_2),
            Rvalue::Cast(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f, "Cast",
                    __self_0, __self_1, &__self_2),
            Rvalue::CheckedBinaryOp(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f,
                    "CheckedBinaryOp", __self_0, __self_1, &__self_2),
            Rvalue::CopyForDeref(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "CopyForDeref", &__self_0),
            Rvalue::Discriminant(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Discriminant", &__self_0),
            Rvalue::Len(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Len",
                    &__self_0),
            Rvalue::Ref(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f, "Ref",
                    __self_0, __self_1, &__self_2),
            Rvalue::Repeat(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Repeat",
                    __self_0, &__self_1),
            Rvalue::ThreadLocalRef(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ThreadLocalRef", &__self_0),
            Rvalue::UnaryOp(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "UnaryOp", __self_0, &__self_1),
            Rvalue::Use(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Use",
                    __self_0, &__self_1),
            Rvalue::Reborrow(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f,
                    "Reborrow", __self_0, __self_1, &__self_2),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Rvalue {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<RawPtrKind>;
        let _: ::core::cmp::AssertParamIsEq<Place>;
        let _: ::core::cmp::AssertParamIsEq<AggregateKind>;
        let _: ::core::cmp::AssertParamIsEq<Vec<Operand>>;
        let _: ::core::cmp::AssertParamIsEq<BinOp>;
        let _: ::core::cmp::AssertParamIsEq<Operand>;
        let _: ::core::cmp::AssertParamIsEq<CastKind>;
        let _: ::core::cmp::AssertParamIsEq<Ty>;
        let _: ::core::cmp::AssertParamIsEq<Region>;
        let _: ::core::cmp::AssertParamIsEq<BorrowKind>;
        let _: ::core::cmp::AssertParamIsEq<TyConst>;
        let _: ::core::cmp::AssertParamIsEq<crate::CrateItem>;
        let _: ::core::cmp::AssertParamIsEq<UnOp>;
        let _: ::core::cmp::AssertParamIsEq<WithRetag>;
        let _: ::core::cmp::AssertParamIsEq<Mutability>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Rvalue {
    #[inline]
    fn eq(&self, other: &Rvalue) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (Rvalue::AddressOf(__self_0, __self_1),
                    Rvalue::AddressOf(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Rvalue::Aggregate(__self_0, __self_1),
                    Rvalue::Aggregate(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Rvalue::BinaryOp(__self_0, __self_1, __self_2),
                    Rvalue::BinaryOp(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Rvalue::Cast(__self_0, __self_1, __self_2),
                    Rvalue::Cast(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Rvalue::CheckedBinaryOp(__self_0, __self_1, __self_2),
                    Rvalue::CheckedBinaryOp(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Rvalue::CopyForDeref(__self_0),
                    Rvalue::CopyForDeref(__arg1_0)) => __self_0 == __arg1_0,
                (Rvalue::Discriminant(__self_0),
                    Rvalue::Discriminant(__arg1_0)) => __self_0 == __arg1_0,
                (Rvalue::Len(__self_0), Rvalue::Len(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Rvalue::Ref(__self_0, __self_1, __self_2),
                    Rvalue::Ref(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Rvalue::Repeat(__self_0, __self_1),
                    Rvalue::Repeat(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Rvalue::ThreadLocalRef(__self_0),
                    Rvalue::ThreadLocalRef(__arg1_0)) => __self_0 == __arg1_0,
                (Rvalue::UnaryOp(__self_0, __self_1),
                    Rvalue::UnaryOp(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Rvalue::Use(__self_0, __self_1),
                    Rvalue::Use(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Rvalue::Reborrow(__self_0, __self_1, __self_2),
                    Rvalue::Reborrow(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for Rvalue {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            Rvalue::AddressOf(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Rvalue::Aggregate(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Rvalue::BinaryOp(__self_0, __self_1, __self_2) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            Rvalue::Cast(__self_0, __self_1, __self_2) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            Rvalue::CheckedBinaryOp(__self_0, __self_1, __self_2) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            Rvalue::CopyForDeref(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Rvalue::Discriminant(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Rvalue::Len(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Rvalue::Ref(__self_0, __self_1, __self_2) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            Rvalue::Repeat(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Rvalue::ThreadLocalRef(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Rvalue::UnaryOp(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Rvalue::Use(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Rvalue::Reborrow(__self_0, __self_1, __self_2) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Rvalue {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    Rvalue::AddressOf(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 0u32, "AddressOf", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::Aggregate(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 1u32, "Aggregate", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::BinaryOp(ref __field0, ref __field1, ref __field2)
                        => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 2u32, "BinaryOp", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::Cast(ref __field0, ref __field1, ref __field2) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 3u32, "Cast", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::CheckedBinaryOp(ref __field0, ref __field1,
                        ref __field2) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 4u32, "CheckedBinaryOp", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::CopyForDeref(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Rvalue", 5u32, "CopyForDeref", __field0),
                    Rvalue::Discriminant(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Rvalue", 6u32, "Discriminant", __field0),
                    Rvalue::Len(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Rvalue", 7u32, "Len", __field0),
                    Rvalue::Ref(ref __field0, ref __field1, ref __field2) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 8u32, "Ref", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::Repeat(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 9u32, "Repeat", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::ThreadLocalRef(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Rvalue", 10u32, "ThreadLocalRef", __field0),
                    Rvalue::UnaryOp(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 11u32, "UnaryOp", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::Use(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 12u32, "Use", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    Rvalue::Reborrow(ref __field0, ref __field1, ref __field2)
                        => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "Rvalue", 13u32, "Reborrow", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                }
            }
        }
    };Serialize)]
492pub enum Rvalue {
493    /// Creates a pointer with the indicated mutability to the place.
494    ///
495    /// This is generated by pointer casts like `&v as *const _` or raw address of expressions like
496    /// `&raw v` or `addr_of!(v)`.
497    AddressOf(RawPtrKind, Place),
498
499    /// Creates an aggregate value, like a tuple or struct.
500    ///
501    /// This is needed because dataflow analysis needs to distinguish
502    /// `dest = Foo { x: ..., y: ... }` from `dest.x = ...; dest.y = ...;` in the case that `Foo`
503    /// has a destructor.
504    ///
505    /// Disallowed after deaggregation for all aggregate kinds except `Array` and `Coroutine`. After
506    /// coroutine lowering, `Coroutine` aggregate kinds are disallowed too.
507    Aggregate(AggregateKind, Vec<Operand>),
508
509    /// * `Offset` has the same semantics as `<*const T>::offset`, except that the second
510    ///   parameter may be a `usize` as well.
511    /// * The comparison operations accept `bool`s, `char`s, signed or unsigned integers, floats,
512    ///   raw pointers, or function pointers and return a `bool`. The types of the operands must be
513    ///   matching, up to the usual caveat of the lifetimes in function pointers.
514    /// * Left and right shift operations accept signed or unsigned integers not necessarily of the
515    ///   same type and return a value of the same type as their LHS. Like in Rust, the RHS is
516    ///   truncated as needed.
517    /// * The `Bit*` operations accept signed integers, unsigned integers, or bools with matching
518    ///   types and return a value of that type.
519    /// * The remaining operations accept signed integers, unsigned integers, or floats with
520    ///   matching types and return a value of that type.
521    BinaryOp(BinOp, Operand, Operand),
522
523    /// Performs essentially all of the casts that can be performed via `as`.
524    ///
525    /// This allows for casts from/to a variety of types.
526    Cast(CastKind, Operand, Ty),
527
528    /// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition.
529    ///
530    /// For addition, subtraction, and multiplication on integers the error condition is set when
531    /// the infinite precision result would not be equal to the actual result.
532    CheckedBinaryOp(BinOp, Operand, Operand),
533
534    /// A CopyForDeref is equivalent to a read from a place.
535    /// When such a read happens, it is guaranteed that the only use of the returned value is a
536    /// deref operation, immediately followed by one or more projections.
537    CopyForDeref(Place),
538
539    /// Computes the discriminant of the place, returning it as an integer.
540    /// Returns zero for types without discriminant.
541    ///
542    /// The validity requirements for the underlying value are undecided for this rvalue, see
543    /// [#91095]. Note too that the value of the discriminant is not the same thing as the
544    /// variant index;
545    ///
546    /// [#91095]: https://github.com/rust-lang/rust/issues/91095
547    Discriminant(Place),
548
549    /// Yields the length of the place, as a `usize`.
550    ///
551    /// If the type of the place is an array, this is the array length. For slices (`[T]`, not
552    /// `&[T]`) this accesses the place's metadata to determine the length. This rvalue is
553    /// ill-formed for places of other types.
554    Len(Place),
555
556    /// Creates a reference to the place.
557    Ref(Region, BorrowKind, Place),
558
559    /// Creates an array where each element is the value of the operand.
560    ///
561    /// This is the cause of a bug in the case where the repetition count is zero because the value
562    /// is not dropped, see [#74836].
563    ///
564    /// Corresponds to source code like `[x; 32]`.
565    ///
566    /// [#74836]: https://github.com/rust-lang/rust/issues/74836
567    Repeat(Operand, TyConst),
568
569    /// Creates a pointer/reference to the given thread local.
570    ///
571    /// The yielded type is a `*mut T` if the static is mutable, otherwise if the static is extern a
572    /// `*const T`, and if neither of those apply a `&T`.
573    ///
574    /// **Note:** This is a runtime operation that actually executes code and is in this sense more
575    /// like a function call. Also, eliminating dead stores of this rvalue causes `fn main() {}` to
576    /// SIGILL for some reason that I (JakobDegen) never got a chance to look into.
577    ///
578    /// **Needs clarification**: Are there weird additional semantics here related to the runtime
579    /// nature of this operation?
580    ThreadLocalRef(crate::CrateItem),
581
582    /// Exactly like `BinaryOp`, but less operands.
583    ///
584    /// Also does two's-complement arithmetic. Negation requires a signed integer or a float;
585    /// bitwise not requires a signed integer, unsigned integer, or bool. Both operation kinds
586    /// return a value with the same type as their operand.
587    UnaryOp(UnOp, Operand),
588
589    /// Yields the operand unchanged, except for possibly a retag.
590    Use(Operand, WithRetag),
591
592    /// Creates a bitwise copy of the source type, producing either a value of the same type (when
593    /// Mutability::Mut) or a different type with a guaranteed equal memory layout defined by the
594    /// CoerceShared trait. See [`Rvalue::Reborrow`] for a more detailed explanation.
595    ///
596    /// [`Rvalue::Reborrow`]: rustc_middle::mir::Rvalue::Reborrow
597    Reborrow(Ty, Mutability, Place),
598}
599
600impl Rvalue {
601    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
602        match self {
603            Rvalue::Use(operand, _) => operand.ty(locals),
604            Rvalue::Repeat(operand, count) => {
605                Ok(Ty::new_array_with_const_len(operand.ty(locals)?, count.clone()))
606            }
607            Rvalue::ThreadLocalRef(did) => Ok(did.ty()),
608            Rvalue::Ref(reg, bk, place) => {
609                let place_ty = place.ty(locals)?;
610                Ok(Ty::new_ref(reg.clone(), place_ty, bk.to_mutable_lossy()))
611            }
612            Rvalue::Reborrow(target, _, _) => Ok(*target),
613            Rvalue::AddressOf(mutability, place) => {
614                let place_ty = place.ty(locals)?;
615                Ok(Ty::new_ptr(place_ty, mutability.to_mutable_lossy()))
616            }
617            Rvalue::Len(..) => Ok(Ty::usize_ty()),
618            Rvalue::Cast(.., ty) => Ok(*ty),
619            Rvalue::BinaryOp(op, lhs, rhs) => {
620                let lhs_ty = lhs.ty(locals)?;
621                let rhs_ty = rhs.ty(locals)?;
622                Ok(op.ty(lhs_ty, rhs_ty))
623            }
624            Rvalue::CheckedBinaryOp(op, lhs, rhs) => {
625                let lhs_ty = lhs.ty(locals)?;
626                let rhs_ty = rhs.ty(locals)?;
627                let ty = op.ty(lhs_ty, rhs_ty);
628                Ok(Ty::new_tuple(&[ty, Ty::bool_ty()]))
629            }
630            Rvalue::UnaryOp(op, operand) => {
631                let arg_ty = operand.ty(locals)?;
632                Ok(op.ty(arg_ty))
633            }
634            Rvalue::Discriminant(place) => {
635                let place_ty = place.ty(locals)?;
636                place_ty
637                    .kind()
638                    .discriminant_ty()
639                    .ok_or_else(|| Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("Expected a `RigidTy` but found: {0:?}",
                    place_ty))
        }))error!("Expected a `RigidTy` but found: {place_ty:?}"))
640            }
641            Rvalue::Aggregate(ak, ops) => match *ak {
642                AggregateKind::Array(ty) => Ty::try_new_array(ty, ops.len() as u64),
643                AggregateKind::Tuple => Ok(Ty::new_tuple(
644                    &ops.iter().map(|op| op.ty(locals)).collect::<Result<Vec<_>, _>>()?,
645                )),
646                AggregateKind::Adt(def, _, ref args, _, _) => Ok(def.ty_with_args(args)),
647                AggregateKind::Closure(def, ref args) => Ok(Ty::new_closure(def, args.clone())),
648                AggregateKind::Coroutine(def, ref args) => Ok(Ty::new_coroutine(def, args.clone())),
649                AggregateKind::CoroutineClosure(def, ref args) => {
650                    Ok(Ty::new_coroutine_closure(def, args.clone()))
651                }
652                AggregateKind::RawPtr(ty, mutability) => Ok(Ty::new_ptr(ty, mutability)),
653            },
654            Rvalue::CopyForDeref(place) => place.ty(locals),
655        }
656    }
657}
658
659#[derive(#[automatically_derived]
impl ::core::clone::Clone for AggregateKind {
    #[inline]
    fn clone(&self) -> AggregateKind {
        match self {
            AggregateKind::Array(__self_0) =>
                AggregateKind::Array(::core::clone::Clone::clone(__self_0)),
            AggregateKind::Tuple => AggregateKind::Tuple,
            AggregateKind::Adt(__self_0, __self_1, __self_2, __self_3,
                __self_4) =>
                AggregateKind::Adt(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2),
                    ::core::clone::Clone::clone(__self_3),
                    ::core::clone::Clone::clone(__self_4)),
            AggregateKind::Closure(__self_0, __self_1) =>
                AggregateKind::Closure(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            AggregateKind::Coroutine(__self_0, __self_1) =>
                AggregateKind::Coroutine(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            AggregateKind::CoroutineClosure(__self_0, __self_1) =>
                AggregateKind::CoroutineClosure(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            AggregateKind::RawPtr(__self_0, __self_1) =>
                AggregateKind::RawPtr(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for AggregateKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            AggregateKind::Array(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Array",
                    &__self_0),
            AggregateKind::Tuple =>
                ::core::fmt::Formatter::write_str(f, "Tuple"),
            AggregateKind::Adt(__self_0, __self_1, __self_2, __self_3,
                __self_4) =>
                ::core::fmt::Formatter::debug_tuple_field5_finish(f, "Adt",
                    __self_0, __self_1, __self_2, __self_3, &__self_4),
            AggregateKind::Closure(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "Closure", __self_0, &__self_1),
            AggregateKind::Coroutine(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "Coroutine", __self_0, &__self_1),
            AggregateKind::CoroutineClosure(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "CoroutineClosure", __self_0, &__self_1),
            AggregateKind::RawPtr(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "RawPtr",
                    __self_0, &__self_1),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for AggregateKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Ty>;
        let _: ::core::cmp::AssertParamIsEq<AdtDef>;
        let _: ::core::cmp::AssertParamIsEq<VariantIdx>;
        let _: ::core::cmp::AssertParamIsEq<GenericArgs>;
        let _: ::core::cmp::AssertParamIsEq<Option<UserTypeAnnotationIndex>>;
        let _: ::core::cmp::AssertParamIsEq<Option<FieldIdx>>;
        let _: ::core::cmp::AssertParamIsEq<ClosureDef>;
        let _: ::core::cmp::AssertParamIsEq<CoroutineDef>;
        let _: ::core::cmp::AssertParamIsEq<CoroutineClosureDef>;
        let _: ::core::cmp::AssertParamIsEq<Mutability>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for AggregateKind {
    #[inline]
    fn eq(&self, other: &AggregateKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (AggregateKind::Array(__self_0),
                    AggregateKind::Array(__arg1_0)) => __self_0 == __arg1_0,
                (AggregateKind::Adt(__self_0, __self_1, __self_2, __self_3,
                    __self_4),
                    AggregateKind::Adt(__arg1_0, __arg1_1, __arg1_2, __arg1_3,
                    __arg1_4)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                                __self_2 == __arg1_2 && __self_3 == __arg1_3 &&
                        __self_4 == __arg1_4,
                (AggregateKind::Closure(__self_0, __self_1),
                    AggregateKind::Closure(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (AggregateKind::Coroutine(__self_0, __self_1),
                    AggregateKind::Coroutine(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (AggregateKind::CoroutineClosure(__self_0, __self_1),
                    AggregateKind::CoroutineClosure(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (AggregateKind::RawPtr(__self_0, __self_1),
                    AggregateKind::RawPtr(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for AggregateKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            AggregateKind::Array(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            AggregateKind::Adt(__self_0, __self_1, __self_2, __self_3,
                __self_4) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state);
                ::core::hash::Hash::hash(__self_3, state);
                ::core::hash::Hash::hash(__self_4, state)
            }
            AggregateKind::Closure(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            AggregateKind::Coroutine(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            AggregateKind::CoroutineClosure(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            AggregateKind::RawPtr(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            _ => {}
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for AggregateKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    AggregateKind::Array(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AggregateKind", 0u32, "Array", __field0),
                    AggregateKind::Tuple =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "AggregateKind", 1u32, "Tuple"),
                    AggregateKind::Adt(ref __field0, ref __field1, ref __field2,
                        ref __field3, ref __field4) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "AggregateKind", 2u32, "Adt", 0 + 1 + 1 + 1 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field2)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field3)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field4)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    AggregateKind::Closure(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "AggregateKind", 3u32, "Closure", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    AggregateKind::Coroutine(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "AggregateKind", 4u32, "Coroutine", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    AggregateKind::CoroutineClosure(ref __field0, ref __field1)
                        => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "AggregateKind", 5u32, "CoroutineClosure", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    AggregateKind::RawPtr(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "AggregateKind", 6u32, "RawPtr", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                }
            }
        }
    };Serialize)]
660pub enum AggregateKind {
661    Array(Ty),
662    Tuple,
663    Adt(AdtDef, VariantIdx, GenericArgs, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
664    Closure(ClosureDef, GenericArgs),
665    Coroutine(CoroutineDef, GenericArgs),
666    CoroutineClosure(CoroutineClosureDef, GenericArgs),
667    RawPtr(Ty, Mutability),
668}
669
670#[derive(#[automatically_derived]
impl ::core::clone::Clone for Operand {
    #[inline]
    fn clone(&self) -> Operand {
        match self {
            Operand::Copy(__self_0) =>
                Operand::Copy(::core::clone::Clone::clone(__self_0)),
            Operand::Move(__self_0) =>
                Operand::Move(::core::clone::Clone::clone(__self_0)),
            Operand::Constant(__self_0) =>
                Operand::Constant(::core::clone::Clone::clone(__self_0)),
            Operand::RuntimeChecks(__self_0) =>
                Operand::RuntimeChecks(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Operand {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Operand::Copy(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Copy",
                    &__self_0),
            Operand::Move(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Move",
                    &__self_0),
            Operand::Constant(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Constant", &__self_0),
            Operand::RuntimeChecks(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "RuntimeChecks", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Operand {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Place>;
        let _: ::core::cmp::AssertParamIsEq<ConstOperand>;
        let _: ::core::cmp::AssertParamIsEq<RuntimeChecks>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Operand {
    #[inline]
    fn eq(&self, other: &Operand) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (Operand::Copy(__self_0), Operand::Copy(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Operand::Move(__self_0), Operand::Move(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Operand::Constant(__self_0), Operand::Constant(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Operand::RuntimeChecks(__self_0),
                    Operand::RuntimeChecks(__arg1_0)) => __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for Operand {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            Operand::Copy(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Operand::Move(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Operand::Constant(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Operand::RuntimeChecks(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Operand {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    Operand::Copy(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Operand", 0u32, "Copy", __field0),
                    Operand::Move(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Operand", 1u32, "Move", __field0),
                    Operand::Constant(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Operand", 2u32, "Constant", __field0),
                    Operand::RuntimeChecks(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Operand", 3u32, "RuntimeChecks", __field0),
                }
            }
        }
    };Serialize)]
671pub enum Operand {
672    Copy(Place),
673    Move(Place),
674    Constant(ConstOperand),
675    RuntimeChecks(RuntimeChecks),
676}
677
678#[derive(#[automatically_derived]
impl ::core::clone::Clone for Place {
    #[inline]
    fn clone(&self) -> Place {
        Place {
            local: ::core::clone::Clone::clone(&self.local),
            projection: ::core::clone::Clone::clone(&self.projection),
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::Eq for Place {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Local>;
        let _: ::core::cmp::AssertParamIsEq<Vec<ProjectionElem>>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Place {
    #[inline]
    fn eq(&self, other: &Place) -> bool {
        self.local == other.local && self.projection == other.projection
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for Place {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.local, state);
        ::core::hash::Hash::hash(&self.projection, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Place {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer, "Place",
                            false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "local", &self.local)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "projection", &self.projection)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
679pub struct Place {
680    pub local: Local,
681    /// projection out of a place (access a field, deref a pointer, etc)
682    pub projection: Vec<ProjectionElem>,
683}
684
685impl From<Local> for Place {
686    fn from(local: Local) -> Self {
687        Place { local, projection: ::alloc::vec::Vec::new()vec![] }
688    }
689}
690
691#[derive(#[automatically_derived]
impl ::core::clone::Clone for ConstOperand {
    #[inline]
    fn clone(&self) -> ConstOperand {
        ConstOperand {
            span: ::core::clone::Clone::clone(&self.span),
            user_ty: ::core::clone::Clone::clone(&self.user_ty),
            const_: ::core::clone::Clone::clone(&self.const_),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for ConstOperand {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "ConstOperand",
            "span", &self.span, "user_ty", &self.user_ty, "const_",
            &&self.const_)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for ConstOperand {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<Option<UserTypeAnnotationIndex>>;
        let _: ::core::cmp::AssertParamIsEq<MirConst>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for ConstOperand {
    #[inline]
    fn eq(&self, other: &ConstOperand) -> bool {
        self.span == other.span && self.user_ty == other.user_ty &&
            self.const_ == other.const_
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for ConstOperand {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.span, state);
        ::core::hash::Hash::hash(&self.user_ty, state);
        ::core::hash::Hash::hash(&self.const_, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for ConstOperand {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "ConstOperand", false as usize + 1 + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "span", &self.span)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "user_ty", &self.user_ty)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "const_", &self.const_)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
692pub struct ConstOperand {
693    pub span: Span,
694    pub user_ty: Option<UserTypeAnnotationIndex>,
695    pub const_: MirConst,
696}
697
698#[derive(#[automatically_derived]
impl ::core::clone::Clone for RuntimeChecks {
    #[inline]
    fn clone(&self) -> RuntimeChecks {
        match self {
            RuntimeChecks::UbChecks => RuntimeChecks::UbChecks,
            RuntimeChecks::ContractChecks => RuntimeChecks::ContractChecks,
            RuntimeChecks::OverflowChecks => RuntimeChecks::OverflowChecks,
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for RuntimeChecks {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                RuntimeChecks::UbChecks => "UbChecks",
                RuntimeChecks::ContractChecks => "ContractChecks",
                RuntimeChecks::OverflowChecks => "OverflowChecks",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for RuntimeChecks {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for RuntimeChecks {
    #[inline]
    fn eq(&self, other: &RuntimeChecks) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for RuntimeChecks {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for RuntimeChecks {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    RuntimeChecks::UbChecks =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RuntimeChecks", 0u32, "UbChecks"),
                    RuntimeChecks::ContractChecks =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RuntimeChecks", 1u32, "ContractChecks"),
                    RuntimeChecks::OverflowChecks =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RuntimeChecks", 2u32, "OverflowChecks"),
                }
            }
        }
    };Serialize)]
699pub enum RuntimeChecks {
700    /// cfg!(ub_checks), but at codegen time
701    UbChecks,
702    /// cfg!(contract_checks), but at codegen time
703    ContractChecks,
704    /// cfg!(overflow_checks), but at codegen time
705    OverflowChecks,
706}
707
708/// Debug information pertaining to a user variable.
709#[derive(#[automatically_derived]
impl ::core::clone::Clone for VarDebugInfo {
    #[inline]
    fn clone(&self) -> VarDebugInfo {
        VarDebugInfo {
            name: ::core::clone::Clone::clone(&self.name),
            source_info: ::core::clone::Clone::clone(&self.source_info),
            composite: ::core::clone::Clone::clone(&self.composite),
            value: ::core::clone::Clone::clone(&self.value),
            argument_index: ::core::clone::Clone::clone(&self.argument_index),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for VarDebugInfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field5_finish(f, "VarDebugInfo",
            "name", &self.name, "source_info", &self.source_info, "composite",
            &self.composite, "value", &self.value, "argument_index",
            &&self.argument_index)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for VarDebugInfo {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Symbol>;
        let _: ::core::cmp::AssertParamIsEq<SourceInfo>;
        let _: ::core::cmp::AssertParamIsEq<Option<VarDebugInfoFragment>>;
        let _: ::core::cmp::AssertParamIsEq<VarDebugInfoContents>;
        let _: ::core::cmp::AssertParamIsEq<Option<u16>>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for VarDebugInfo {
    #[inline]
    fn eq(&self, other: &VarDebugInfo) -> bool {
        self.name == other.name && self.source_info == other.source_info &&
                    self.composite == other.composite &&
                self.value == other.value &&
            self.argument_index == other.argument_index
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for VarDebugInfo {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "VarDebugInfo", false as usize + 1 + 1 + 1 + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "name", &self.name)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "source_info", &self.source_info)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "composite", &self.composite)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "value", &self.value)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "argument_index", &self.argument_index)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
710pub struct VarDebugInfo {
711    /// The variable name.
712    pub name: Symbol,
713
714    /// Source info of the user variable, including the scope
715    /// within which the variable is visible (to debuginfo).
716    pub source_info: SourceInfo,
717
718    /// The user variable's data is split across several fragments,
719    /// each described by a `VarDebugInfoFragment`.
720    pub composite: Option<VarDebugInfoFragment>,
721
722    /// Where the data for this user variable is to be found.
723    pub value: VarDebugInfoContents,
724
725    /// When present, indicates what argument number this variable is in the function that it
726    /// originated from (starting from 1). Note, if MIR inlining is enabled, then this is the
727    /// argument number in the original function before it was inlined.
728    pub argument_index: Option<u16>,
729}
730
731impl VarDebugInfo {
732    /// Return a local variable if this info is related to one.
733    pub fn local(&self) -> Option<Local> {
734        match &self.value {
735            VarDebugInfoContents::Place(place) if place.projection.is_empty() => Some(place.local),
736            VarDebugInfoContents::Place(_) | VarDebugInfoContents::Const(_) => None,
737        }
738    }
739
740    /// Return a constant if this info is related to one.
741    pub fn constant(&self) -> Option<&ConstOperand> {
742        match &self.value {
743            VarDebugInfoContents::Place(_) => None,
744            VarDebugInfoContents::Const(const_op) => Some(const_op),
745        }
746    }
747}
748
749pub type SourceScope = u32;
750
751#[derive(#[automatically_derived]
impl ::core::clone::Clone for SourceInfo {
    #[inline]
    fn clone(&self) -> SourceInfo {
        SourceInfo {
            span: ::core::clone::Clone::clone(&self.span),
            scope: ::core::clone::Clone::clone(&self.scope),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for SourceInfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "SourceInfo",
            "span", &self.span, "scope", &&self.scope)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for SourceInfo {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<SourceScope>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for SourceInfo {
    #[inline]
    fn eq(&self, other: &SourceInfo) -> bool {
        self.span == other.span && self.scope == other.scope
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for SourceInfo {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "SourceInfo", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "span", &self.span)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "scope", &self.scope)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
752pub struct SourceInfo {
753    pub span: Span,
754    pub scope: SourceScope,
755}
756
757#[derive(#[automatically_derived]
impl ::core::clone::Clone for VarDebugInfoFragment {
    #[inline]
    fn clone(&self) -> VarDebugInfoFragment {
        VarDebugInfoFragment {
            ty: ::core::clone::Clone::clone(&self.ty),
            projection: ::core::clone::Clone::clone(&self.projection),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for VarDebugInfoFragment {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "VarDebugInfoFragment", "ty", &self.ty, "projection",
            &&self.projection)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for VarDebugInfoFragment {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Ty>;
        let _: ::core::cmp::AssertParamIsEq<Vec<ProjectionElem>>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for VarDebugInfoFragment {
    #[inline]
    fn eq(&self, other: &VarDebugInfoFragment) -> bool {
        self.ty == other.ty && self.projection == other.projection
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for VarDebugInfoFragment {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "VarDebugInfoFragment", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "ty", &self.ty)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "projection", &self.projection)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
758pub struct VarDebugInfoFragment {
759    pub ty: Ty,
760    pub projection: Vec<ProjectionElem>,
761}
762
763#[derive(#[automatically_derived]
impl ::core::clone::Clone for VarDebugInfoContents {
    #[inline]
    fn clone(&self) -> VarDebugInfoContents {
        match self {
            VarDebugInfoContents::Place(__self_0) =>
                VarDebugInfoContents::Place(::core::clone::Clone::clone(__self_0)),
            VarDebugInfoContents::Const(__self_0) =>
                VarDebugInfoContents::Const(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for VarDebugInfoContents {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            VarDebugInfoContents::Place(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Place",
                    &__self_0),
            VarDebugInfoContents::Const(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Const",
                    &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for VarDebugInfoContents {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Place>;
        let _: ::core::cmp::AssertParamIsEq<ConstOperand>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for VarDebugInfoContents {
    #[inline]
    fn eq(&self, other: &VarDebugInfoContents) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (VarDebugInfoContents::Place(__self_0),
                    VarDebugInfoContents::Place(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (VarDebugInfoContents::Const(__self_0),
                    VarDebugInfoContents::Const(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for VarDebugInfoContents {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    VarDebugInfoContents::Place(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "VarDebugInfoContents", 0u32, "Place", __field0),
                    VarDebugInfoContents::Const(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "VarDebugInfoContents", 1u32, "Const", __field0),
                }
            }
        }
    };Serialize)]
764pub enum VarDebugInfoContents {
765    Place(Place),
766    Const(ConstOperand),
767}
768
769// In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This
770// is so it can be used for both Places (for which the projection elements are of type
771// ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements
772// are of type ProjectionElem<(), ()>).
773// In rustc_public's IR we don't need this generality, so we just use ProjectionElem for Places.
774#[derive(#[automatically_derived]
impl ::core::clone::Clone for ProjectionElem {
    #[inline]
    fn clone(&self) -> ProjectionElem {
        match self {
            ProjectionElem::Deref => ProjectionElem::Deref,
            ProjectionElem::Field(__self_0, __self_1) =>
                ProjectionElem::Field(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ProjectionElem::Index(__self_0) =>
                ProjectionElem::Index(::core::clone::Clone::clone(__self_0)),
            ProjectionElem::ConstantIndex {
                offset: __self_0, min_length: __self_1, from_end: __self_2 }
                =>
                ProjectionElem::ConstantIndex {
                    offset: ::core::clone::Clone::clone(__self_0),
                    min_length: ::core::clone::Clone::clone(__self_1),
                    from_end: ::core::clone::Clone::clone(__self_2),
                },
            ProjectionElem::Subslice {
                from: __self_0, to: __self_1, from_end: __self_2 } =>
                ProjectionElem::Subslice {
                    from: ::core::clone::Clone::clone(__self_0),
                    to: ::core::clone::Clone::clone(__self_1),
                    from_end: ::core::clone::Clone::clone(__self_2),
                },
            ProjectionElem::Downcast(__self_0) =>
                ProjectionElem::Downcast(::core::clone::Clone::clone(__self_0)),
            ProjectionElem::OpaqueCast(__self_0) =>
                ProjectionElem::OpaqueCast(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for ProjectionElem {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            ProjectionElem::Deref =>
                ::core::fmt::Formatter::write_str(f, "Deref"),
            ProjectionElem::Field(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Field",
                    __self_0, &__self_1),
            ProjectionElem::Index(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Index",
                    &__self_0),
            ProjectionElem::ConstantIndex {
                offset: __self_0, min_length: __self_1, from_end: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "ConstantIndex", "offset", __self_0, "min_length", __self_1,
                    "from_end", &__self_2),
            ProjectionElem::Subslice {
                from: __self_0, to: __self_1, from_end: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Subslice", "from", __self_0, "to", __self_1, "from_end",
                    &__self_2),
            ProjectionElem::Downcast(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Downcast", &__self_0),
            ProjectionElem::OpaqueCast(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "OpaqueCast", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for ProjectionElem {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<FieldIdx>;
        let _: ::core::cmp::AssertParamIsEq<Ty>;
        let _: ::core::cmp::AssertParamIsEq<Local>;
        let _: ::core::cmp::AssertParamIsEq<u64>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
        let _: ::core::cmp::AssertParamIsEq<VariantIdx>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for ProjectionElem {
    #[inline]
    fn eq(&self, other: &ProjectionElem) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (ProjectionElem::Field(__self_0, __self_1),
                    ProjectionElem::Field(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ProjectionElem::Index(__self_0),
                    ProjectionElem::Index(__arg1_0)) => __self_0 == __arg1_0,
                (ProjectionElem::ConstantIndex {
                    offset: __self_0, min_length: __self_1, from_end: __self_2
                    }, ProjectionElem::ConstantIndex {
                    offset: __arg1_0, min_length: __arg1_1, from_end: __arg1_2
                    }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (ProjectionElem::Subslice {
                    from: __self_0, to: __self_1, from_end: __self_2 },
                    ProjectionElem::Subslice {
                    from: __arg1_0, to: __arg1_1, from_end: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (ProjectionElem::Downcast(__self_0),
                    ProjectionElem::Downcast(__arg1_0)) => __self_0 == __arg1_0,
                (ProjectionElem::OpaqueCast(__self_0),
                    ProjectionElem::OpaqueCast(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for ProjectionElem {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            ProjectionElem::Field(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            ProjectionElem::Index(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            ProjectionElem::ConstantIndex {
                offset: __self_0, min_length: __self_1, from_end: __self_2 }
                => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            ProjectionElem::Subslice {
                from: __self_0, to: __self_1, from_end: __self_2 } => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            ProjectionElem::Downcast(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            ProjectionElem::OpaqueCast(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for ProjectionElem {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    ProjectionElem::Deref =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "ProjectionElem", 0u32, "Deref"),
                    ProjectionElem::Field(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "ProjectionElem", 1u32, "Field", 0 + 1 + 1)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field0)?;
                        _serde::ser::SerializeTupleVariant::serialize_field(&mut __serde_state,
                                __field1)?;
                        _serde::ser::SerializeTupleVariant::end(__serde_state)
                    }
                    ProjectionElem::Index(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "ProjectionElem", 2u32, "Index", __field0),
                    ProjectionElem::ConstantIndex {
                        ref offset, ref min_length, ref from_end } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "ProjectionElem", 3u32, "ConstantIndex", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "offset", offset)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "min_length", min_length)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "from_end", from_end)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    ProjectionElem::Subslice { ref from, ref to, ref from_end }
                        => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "ProjectionElem", 4u32, "Subslice", 0 + 1 + 1 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "from", from)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "to", to)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "from_end", from_end)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                    ProjectionElem::Downcast(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "ProjectionElem", 5u32, "Downcast", __field0),
                    ProjectionElem::OpaqueCast(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "ProjectionElem", 6u32, "OpaqueCast", __field0),
                }
            }
        }
    };Serialize)]
775pub enum ProjectionElem {
776    /// Dereference projections (e.g. `*_1`) project to the address referenced by the base place.
777    Deref,
778
779    /// A field projection (e.g., `f` in `_1.f`) project to a field in the base place. The field is
780    /// referenced by source-order index rather than the name of the field. The fields type is also
781    /// given.
782    Field(FieldIdx, Ty),
783
784    /// Index into a slice/array. The value of the index is computed at runtime using the `V`
785    /// argument.
786    ///
787    /// Note that this does not also dereference, and so it does not exactly correspond to slice
788    /// indexing in Rust. In other words, in the below Rust code:
789    ///
790    /// ```rust
791    /// let x = &[1, 2, 3, 4];
792    /// let i = 2;
793    /// x[i];
794    /// ```
795    ///
796    /// The `x[i]` is turned into a `Deref` followed by an `Index`, not just an `Index`. The same
797    /// thing is true of the `ConstantIndex` and `Subslice` projections below.
798    Index(Local),
799
800    /// Index into a slice/array given by offsets.
801    ///
802    /// These indices are generated by slice patterns. Easiest to explain by example:
803    ///
804    /// ```ignore (illustrative)
805    /// [X, _, .._, _, _] => { offset: 0, min_length: 4, from_end: false },
806    /// [_, X, .._, _, _] => { offset: 1, min_length: 4, from_end: false },
807    /// [_, _, .._, X, _] => { offset: 2, min_length: 4, from_end: true },
808    /// [_, _, .._, _, X] => { offset: 1, min_length: 4, from_end: true },
809    /// ```
810    ConstantIndex {
811        /// index or -index (in Python terms), depending on from_end
812        offset: u64,
813        /// The thing being indexed must be at least this long -- otherwise, the
814        /// projection is UB.
815        ///
816        /// For arrays this is always the exact length.
817        min_length: u64,
818        /// Counting backwards from end? This is always false when indexing an
819        /// array.
820        from_end: bool,
821    },
822
823    /// Projects a slice from the base place.
824    ///
825    /// These indices are generated by slice patterns. If `from_end` is true, this represents
826    /// `slice[from..slice.len() - to]`. Otherwise it represents `array[from..to]`.
827    Subslice {
828        from: u64,
829        to: u64,
830        /// Whether `to` counts from the start or end of the array/slice.
831        from_end: bool,
832    },
833
834    /// "Downcast" to a variant of an enum or a coroutine.
835    Downcast(VariantIdx),
836
837    /// Like an explicit cast from an opaque type to a concrete type, but without
838    /// requiring an intermediate variable.
839    OpaqueCast(Ty),
840}
841
842#[derive(#[automatically_derived]
impl ::core::clone::Clone for UserTypeProjection {
    #[inline]
    fn clone(&self) -> UserTypeProjection {
        UserTypeProjection {
            base: ::core::clone::Clone::clone(&self.base),
            projection: ::core::clone::Clone::clone(&self.projection),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for UserTypeProjection {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "UserTypeProjection", "base", &self.base, "projection",
            &&self.projection)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for UserTypeProjection {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<UserTypeAnnotationIndex>;
        let _: ::core::cmp::AssertParamIsEq<Opaque>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for UserTypeProjection {
    #[inline]
    fn eq(&self, other: &UserTypeProjection) -> bool {
        self.base == other.base && self.projection == other.projection
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for UserTypeProjection {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "UserTypeProjection", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "base", &self.base)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "projection", &self.projection)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
843pub struct UserTypeProjection {
844    pub base: UserTypeAnnotationIndex,
845
846    pub projection: Opaque,
847}
848
849pub type Local = usize;
850
851pub const RETURN_LOCAL: Local = 0;
852
853/// The source-order index of a field in a variant.
854///
855/// For example, in the following types,
856/// ```ignore(illustrative)
857/// enum Demo1 {
858///    Variant0 { a: bool, b: i32 },
859///    Variant1 { c: u8, d: u64 },
860/// }
861/// struct Demo2 { e: u8, f: u16, g: u8 }
862/// ```
863/// `a`'s `FieldIdx` is `0`,
864/// `b`'s `FieldIdx` is `1`,
865/// `c`'s `FieldIdx` is `0`, and
866/// `g`'s `FieldIdx` is `2`.
867pub type FieldIdx = usize;
868
869type UserTypeAnnotationIndex = usize;
870
871/// The possible branch sites of a [TerminatorKind::SwitchInt].
872#[derive(#[automatically_derived]
impl ::core::clone::Clone for SwitchTargets {
    #[inline]
    fn clone(&self) -> SwitchTargets {
        SwitchTargets {
            branches: ::core::clone::Clone::clone(&self.branches),
            otherwise: ::core::clone::Clone::clone(&self.otherwise),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for SwitchTargets {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "SwitchTargets",
            "branches", &self.branches, "otherwise", &&self.otherwise)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for SwitchTargets {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Vec<(u128, BasicBlockIdx)>>;
        let _: ::core::cmp::AssertParamIsEq<BasicBlockIdx>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for SwitchTargets {
    #[inline]
    fn eq(&self, other: &SwitchTargets) -> bool {
        self.branches == other.branches && self.otherwise == other.otherwise
    }
}PartialEq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for SwitchTargets {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                let mut __serde_state =
                    _serde::Serializer::serialize_struct(__serializer,
                            "SwitchTargets", false as usize + 1 + 1)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "branches", &self.branches)?;
                _serde::ser::SerializeStruct::serialize_field(&mut __serde_state,
                        "otherwise", &self.otherwise)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
873pub struct SwitchTargets {
874    /// The conditional branches where the first element represents the value that guards this
875    /// branch, and the second element is the branch target.
876    branches: Vec<(u128, BasicBlockIdx)>,
877    /// The `otherwise` branch which will be taken in case none of the conditional branches are
878    /// satisfied.
879    otherwise: BasicBlockIdx,
880}
881
882impl SwitchTargets {
883    /// All possible targets including the `otherwise` target.
884    pub fn all_targets(&self) -> Successors {
885        self.branches.iter().map(|(_, target)| *target).chain(Some(self.otherwise)).collect()
886    }
887
888    /// The `otherwise` branch target.
889    pub fn otherwise(&self) -> BasicBlockIdx {
890        self.otherwise
891    }
892
893    /// The conditional targets which are only taken if the pattern matches the given value.
894    pub fn branches(&self) -> impl Iterator<Item = (u128, BasicBlockIdx)> {
895        self.branches.iter().copied()
896    }
897
898    /// The number of targets including `otherwise`.
899    pub fn len(&self) -> usize {
900        self.branches.len() + 1
901    }
902
903    /// Create a new SwitchTargets from the given branches and `otherwise` target.
904    pub fn new(branches: Vec<(u128, BasicBlockIdx)>, otherwise: BasicBlockIdx) -> SwitchTargets {
905        SwitchTargets { branches, otherwise }
906    }
907}
908
909#[derive(#[automatically_derived]
impl ::core::marker::Copy for BorrowKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for BorrowKind {
    #[inline]
    fn clone(&self) -> BorrowKind {
        let _: ::core::clone::AssertParamIsClone<FakeBorrowKind>;
        let _: ::core::clone::AssertParamIsClone<MutBorrowKind>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for BorrowKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            BorrowKind::Shared =>
                ::core::fmt::Formatter::write_str(f, "Shared"),
            BorrowKind::Fake(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Fake",
                    &__self_0),
            BorrowKind::Mut { kind: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Mut",
                    "kind", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for BorrowKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<FakeBorrowKind>;
        let _: ::core::cmp::AssertParamIsEq<MutBorrowKind>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for BorrowKind {
    #[inline]
    fn eq(&self, other: &BorrowKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (BorrowKind::Fake(__self_0), BorrowKind::Fake(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (BorrowKind::Mut { kind: __self_0 }, BorrowKind::Mut {
                    kind: __arg1_0 }) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for BorrowKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            BorrowKind::Fake(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            BorrowKind::Mut { kind: __self_0 } =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for BorrowKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    BorrowKind::Shared =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "BorrowKind", 0u32, "Shared"),
                    BorrowKind::Fake(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "BorrowKind", 1u32, "Fake", __field0),
                    BorrowKind::Mut { ref kind } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "BorrowKind", 2u32, "Mut", 0 + 1)?;
                        _serde::ser::SerializeStructVariant::serialize_field(&mut __serde_state,
                                "kind", kind)?;
                        _serde::ser::SerializeStructVariant::end(__serde_state)
                    }
                }
            }
        }
    };Serialize)]
910pub enum BorrowKind {
911    /// Data must be immutable and is aliasable.
912    Shared,
913
914    /// An immutable, aliasable borrow that is discarded after borrow-checking. Can behave either
915    /// like a normal shared borrow or like a special shallow borrow (see [`FakeBorrowKind`]).
916    Fake(FakeBorrowKind),
917
918    /// Data is mutable and not aliasable.
919    Mut {
920        /// `true` if this borrow arose from method-call auto-ref
921        kind: MutBorrowKind,
922    },
923}
924
925impl BorrowKind {
926    pub fn to_mutable_lossy(self) -> Mutability {
927        match self {
928            BorrowKind::Mut { .. } => Mutability::Mut,
929            BorrowKind::Shared => Mutability::Not,
930            // FIXME: There's no type corresponding to a shallow borrow, so use `&` as an approximation.
931            BorrowKind::Fake(_) => Mutability::Not,
932        }
933    }
934}
935
936#[derive(#[automatically_derived]
impl ::core::marker::Copy for RawPtrKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for RawPtrKind {
    #[inline]
    fn clone(&self) -> RawPtrKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for RawPtrKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                RawPtrKind::Mut => "Mut",
                RawPtrKind::Const => "Const",
                RawPtrKind::FakeForPtrMetadata => "FakeForPtrMetadata",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for RawPtrKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for RawPtrKind {
    #[inline]
    fn eq(&self, other: &RawPtrKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for RawPtrKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for RawPtrKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    RawPtrKind::Mut =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RawPtrKind", 0u32, "Mut"),
                    RawPtrKind::Const =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RawPtrKind", 1u32, "Const"),
                    RawPtrKind::FakeForPtrMetadata =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RawPtrKind", 2u32, "FakeForPtrMetadata"),
                }
            }
        }
    };Serialize)]
937pub enum RawPtrKind {
938    Mut,
939    Const,
940    FakeForPtrMetadata,
941}
942
943impl RawPtrKind {
944    pub fn to_mutable_lossy(self) -> Mutability {
945        match self {
946            RawPtrKind::Mut { .. } => Mutability::Mut,
947            RawPtrKind::Const => Mutability::Not,
948            // FIXME: There's no type corresponding to a shallow borrow, so use `&` as an approximation.
949            RawPtrKind::FakeForPtrMetadata => Mutability::Not,
950        }
951    }
952}
953
954#[derive(#[automatically_derived]
impl ::core::marker::Copy for MutBorrowKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for MutBorrowKind {
    #[inline]
    fn clone(&self) -> MutBorrowKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for MutBorrowKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                MutBorrowKind::Default => "Default",
                MutBorrowKind::TwoPhaseBorrow => "TwoPhaseBorrow",
                MutBorrowKind::ClosureCapture => "ClosureCapture",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for MutBorrowKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for MutBorrowKind {
    #[inline]
    fn eq(&self, other: &MutBorrowKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for MutBorrowKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for MutBorrowKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    MutBorrowKind::Default =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "MutBorrowKind", 0u32, "Default"),
                    MutBorrowKind::TwoPhaseBorrow =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "MutBorrowKind", 1u32, "TwoPhaseBorrow"),
                    MutBorrowKind::ClosureCapture =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "MutBorrowKind", 2u32, "ClosureCapture"),
                }
            }
        }
    };Serialize)]
955pub enum MutBorrowKind {
956    Default,
957    TwoPhaseBorrow,
958    ClosureCapture,
959}
960
961#[derive(#[automatically_derived]
impl ::core::marker::Copy for FakeBorrowKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for FakeBorrowKind {
    #[inline]
    fn clone(&self) -> FakeBorrowKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for FakeBorrowKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                FakeBorrowKind::Deep => "Deep",
                FakeBorrowKind::Shallow => "Shallow",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for FakeBorrowKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for FakeBorrowKind {
    #[inline]
    fn eq(&self, other: &FakeBorrowKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for FakeBorrowKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for FakeBorrowKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    FakeBorrowKind::Deep =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "FakeBorrowKind", 0u32, "Deep"),
                    FakeBorrowKind::Shallow =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "FakeBorrowKind", 1u32, "Shallow"),
                }
            }
        }
    };Serialize)]
962pub enum FakeBorrowKind {
963    /// A shared (deep) borrow. Data must be immutable and is aliasable.
964    Deep,
965    /// The immediately borrowed place must be immutable, but projections from
966    /// it don't need to be. This is used to prevent match guards from replacing
967    /// the scrutinee. For example, a fake borrow of `a.b` doesn't
968    /// conflict with a mutable borrow of `a.b.c`.
969    Shallow,
970}
971
972#[derive(#[automatically_derived]
impl ::core::marker::Copy for Mutability { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Mutability {
    #[inline]
    fn clone(&self) -> Mutability { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Mutability {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                Mutability::Not => "Not",
                Mutability::Mut => "Mut",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for Mutability {
    #[inline]
    fn eq(&self, other: &Mutability) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Mutability {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::hash::Hash for Mutability {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Mutability {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    Mutability::Not =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Mutability", 0u32, "Not"),
                    Mutability::Mut =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Mutability", 1u32, "Mut"),
                }
            }
        }
    };Serialize)]
973pub enum Mutability {
974    Not,
975    Mut,
976}
977
978#[derive(#[automatically_derived]
impl ::core::marker::Copy for Safety { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Safety {
    #[inline]
    fn clone(&self) -> Safety { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Safety {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                Safety::Safe => "Safe",
                Safety::Unsafe => "Unsafe",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Safety {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Safety {
    #[inline]
    fn eq(&self, other: &Safety) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for Safety {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for Safety {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    Safety::Safe =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Safety", 0u32, "Safe"),
                    Safety::Unsafe =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "Safety", 1u32, "Unsafe"),
                }
            }
        }
    };Serialize)]
979pub enum Safety {
980    Safe,
981    Unsafe,
982}
983
984#[derive(#[automatically_derived]
impl ::core::marker::Copy for PointerCoercion { }Copy, #[automatically_derived]
impl ::core::clone::Clone for PointerCoercion {
    #[inline]
    fn clone(&self) -> PointerCoercion {
        let _: ::core::clone::AssertParamIsClone<Safety>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for PointerCoercion {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            PointerCoercion::ReifyFnPointer(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ReifyFnPointer", &__self_0),
            PointerCoercion::UnsafeFnPointer =>
                ::core::fmt::Formatter::write_str(f, "UnsafeFnPointer"),
            PointerCoercion::ClosureFnPointer(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ClosureFnPointer", &__self_0),
            PointerCoercion::MutToConstPointer =>
                ::core::fmt::Formatter::write_str(f, "MutToConstPointer"),
            PointerCoercion::ArrayToPointer =>
                ::core::fmt::Formatter::write_str(f, "ArrayToPointer"),
            PointerCoercion::Unsize =>
                ::core::fmt::Formatter::write_str(f, "Unsize"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for PointerCoercion {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Safety>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for PointerCoercion {
    #[inline]
    fn eq(&self, other: &PointerCoercion) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (PointerCoercion::ReifyFnPointer(__self_0),
                    PointerCoercion::ReifyFnPointer(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (PointerCoercion::ClosureFnPointer(__self_0),
                    PointerCoercion::ClosureFnPointer(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for PointerCoercion {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            PointerCoercion::ReifyFnPointer(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            PointerCoercion::ClosureFnPointer(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for PointerCoercion {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    PointerCoercion::ReifyFnPointer(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "PointerCoercion", 0u32, "ReifyFnPointer", __field0),
                    PointerCoercion::UnsafeFnPointer =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "PointerCoercion", 1u32, "UnsafeFnPointer"),
                    PointerCoercion::ClosureFnPointer(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "PointerCoercion", 2u32, "ClosureFnPointer", __field0),
                    PointerCoercion::MutToConstPointer =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "PointerCoercion", 3u32, "MutToConstPointer"),
                    PointerCoercion::ArrayToPointer =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "PointerCoercion", 4u32, "ArrayToPointer"),
                    PointerCoercion::Unsize =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "PointerCoercion", 5u32, "Unsize"),
                }
            }
        }
    };Serialize)]
985pub enum PointerCoercion {
986    /// Go from a fn-item type to a fn-pointer type.
987    ReifyFnPointer(Safety),
988
989    /// Go from a safe fn pointer to an unsafe fn pointer.
990    UnsafeFnPointer,
991
992    /// Go from a non-capturing closure to a fn pointer or an unsafe fn pointer.
993    /// It cannot convert a closure that requires unsafe.
994    ClosureFnPointer(Safety),
995
996    /// Go from a mut raw pointer to a const raw pointer.
997    MutToConstPointer,
998
999    /// Go from `*const [T; N]` to `*const T`
1000    ArrayToPointer,
1001
1002    /// Unsize a pointer/reference value, e.g., `&[T; n]` to
1003    /// `&[T]`. Note that the source could be a thin or wide pointer.
1004    /// This will do things like convert thin pointers to wide
1005    /// pointers, or convert structs containing thin pointers to
1006    /// structs containing wide pointers, or convert between wide
1007    /// pointers.
1008    Unsize,
1009}
1010
1011#[derive(#[automatically_derived]
impl ::core::marker::Copy for CastKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CastKind {
    #[inline]
    fn clone(&self) -> CastKind {
        let _: ::core::clone::AssertParamIsClone<PointerCoercion>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for CastKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            CastKind::PointerExposeAddress =>
                ::core::fmt::Formatter::write_str(f, "PointerExposeAddress"),
            CastKind::PointerWithExposedProvenance =>
                ::core::fmt::Formatter::write_str(f,
                    "PointerWithExposedProvenance"),
            CastKind::PointerCoercion(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "PointerCoercion", &__self_0),
            CastKind::IntToInt =>
                ::core::fmt::Formatter::write_str(f, "IntToInt"),
            CastKind::FloatToInt =>
                ::core::fmt::Formatter::write_str(f, "FloatToInt"),
            CastKind::FloatToFloat =>
                ::core::fmt::Formatter::write_str(f, "FloatToFloat"),
            CastKind::IntToFloat =>
                ::core::fmt::Formatter::write_str(f, "IntToFloat"),
            CastKind::PtrToPtr =>
                ::core::fmt::Formatter::write_str(f, "PtrToPtr"),
            CastKind::FnPtrToPtr =>
                ::core::fmt::Formatter::write_str(f, "FnPtrToPtr"),
            CastKind::Transmute =>
                ::core::fmt::Formatter::write_str(f, "Transmute"),
            CastKind::Subtype =>
                ::core::fmt::Formatter::write_str(f, "Subtype"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for CastKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<PointerCoercion>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for CastKind {
    #[inline]
    fn eq(&self, other: &CastKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CastKind::PointerCoercion(__self_0),
                    CastKind::PointerCoercion(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for CastKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CastKind::PointerCoercion(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl _serde::Serialize for CastKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    CastKind::PointerExposeAddress =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 0u32, "PointerExposeAddress"),
                    CastKind::PointerWithExposedProvenance =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 1u32, "PointerWithExposedProvenance"),
                    CastKind::PointerCoercion(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "CastKind", 2u32, "PointerCoercion", __field0),
                    CastKind::IntToInt =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 3u32, "IntToInt"),
                    CastKind::FloatToInt =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 4u32, "FloatToInt"),
                    CastKind::FloatToFloat =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 5u32, "FloatToFloat"),
                    CastKind::IntToFloat =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 6u32, "IntToFloat"),
                    CastKind::PtrToPtr =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 7u32, "PtrToPtr"),
                    CastKind::FnPtrToPtr =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 8u32, "FnPtrToPtr"),
                    CastKind::Transmute =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 9u32, "Transmute"),
                    CastKind::Subtype =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "CastKind", 10u32, "Subtype"),
                }
            }
        }
    };Serialize)]
1012pub enum CastKind {
1013    // FIXME(smir-rename): rename this to PointerExposeProvenance
1014    PointerExposeAddress,
1015    PointerWithExposedProvenance,
1016    PointerCoercion(PointerCoercion),
1017    IntToInt,
1018    FloatToInt,
1019    FloatToFloat,
1020    IntToFloat,
1021    PtrToPtr,
1022    FnPtrToPtr,
1023    Transmute,
1024    Subtype,
1025}
1026
1027impl Operand {
1028    /// Get the type of an operand relative to the local declaration.
1029    ///
1030    /// In order to retrieve the correct type, the `locals` argument must match the list of all
1031    /// locals from the function body where this operand originates from.
1032    ///
1033    /// Errors indicate a malformed operand or incompatible locals list.
1034    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
1035        match self {
1036            Operand::Copy(place) | Operand::Move(place) => place.ty(locals),
1037            Operand::Constant(c) => Ok(c.ty()),
1038            Operand::RuntimeChecks(_) => Ok(Ty::bool_ty()),
1039        }
1040    }
1041}
1042
1043impl ConstOperand {
1044    pub fn ty(&self) -> Ty {
1045        self.const_.ty()
1046    }
1047}
1048
1049impl Place {
1050    /// Resolve down the chain of projections to get the type referenced at the end of it.
1051    /// E.g.:
1052    /// Calling `ty()` on `var.field` should return the type of `field`.
1053    ///
1054    /// In order to retrieve the correct type, the `locals` argument must match the list of all
1055    /// locals from the function body where this place originates from.
1056    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
1057        self.projection.iter().try_fold(locals[self.local].ty, |place_ty, elem| elem.ty(place_ty))
1058    }
1059}
1060
1061impl ProjectionElem {
1062    /// Get the expected type after applying this projection to a given place type.
1063    pub fn ty(&self, place_ty: Ty) -> Result<Ty, Error> {
1064        let ty = place_ty;
1065        match &self {
1066            ProjectionElem::Deref => Self::deref_ty(ty),
1067            ProjectionElem::Field(_idx, fty) => Ok(*fty),
1068            ProjectionElem::Index(_) | ProjectionElem::ConstantIndex { .. } => Self::index_ty(ty),
1069            ProjectionElem::Subslice { from, to, from_end } => {
1070                Self::subslice_ty(ty, *from, *to, *from_end)
1071            }
1072            ProjectionElem::Downcast(_) => Ok(ty),
1073            ProjectionElem::OpaqueCast(ty) => Ok(*ty),
1074        }
1075    }
1076
1077    fn index_ty(ty: Ty) -> Result<Ty, Error> {
1078        ty.kind().builtin_index().ok_or_else(|| Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("Cannot index non-array type: {0:?}",
                    ty))
        }))error!("Cannot index non-array type: {ty:?}"))
1079    }
1080
1081    fn subslice_ty(ty: Ty, from: u64, to: u64, from_end: bool) -> Result<Ty, Error> {
1082        let ty_kind = ty.kind();
1083        match ty_kind {
1084            TyKind::RigidTy(RigidTy::Slice(..)) => Ok(ty),
1085            TyKind::RigidTy(RigidTy::Array(inner, _)) if !from_end => Ty::try_new_array(
1086                inner,
1087                to.checked_sub(from).ok_or_else(|| Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("Subslice overflow: {0}..{1}",
                    from, to))
        }))error!("Subslice overflow: {from}..{to}"))?,
1088            ),
1089            TyKind::RigidTy(RigidTy::Array(inner, size)) => {
1090                let size = size.eval_target_usize()?;
1091                let len = size - from - to;
1092                Ty::try_new_array(inner, len)
1093            }
1094            _ => Err(Error(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("Cannot subslice non-array type: `{0:?}`",
                ty_kind))
    })format!("Cannot subslice non-array type: `{ty_kind:?}`"))),
1095        }
1096    }
1097
1098    fn deref_ty(ty: Ty) -> Result<Ty, Error> {
1099        let deref_ty = ty
1100            .kind()
1101            .builtin_deref(true)
1102            .ok_or_else(|| Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("Cannot dereference type: {0:?}",
                    ty))
        }))error!("Cannot dereference type: {ty:?}"))?;
1103        Ok(deref_ty.ty)
1104    }
1105}