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_receiver_is_total_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_receiver_is_total_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),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}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, "span", &&self.span)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Terminator {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<TerminatorKind>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Terminator {
    #[inline]
    fn eq(&self, other: &Terminator) -> bool {
        self.kind == other.kind && self.span == other.span
    }
}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,
                        "span", &self.span)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
140pub struct Terminator {
141    pub kind: TerminatorKind,
142    pub span: Span,
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_receiver_is_total_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_receiver_is_total_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_receiver_is_total_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::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::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_receiver_is_total_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::InvalidEnumConstruction(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "AssertMessage", 10u32, "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    InvalidEnumConstruction(Operand),
273}
274
275impl AssertMessage {
276    pub fn description(&self) -> Result<&'static str, Error> {
277        match self {
278            AssertMessage::Overflow(BinOp::Add, _, _) => Ok("attempt to add with overflow"),
279            AssertMessage::Overflow(BinOp::Sub, _, _) => Ok("attempt to subtract with overflow"),
280            AssertMessage::Overflow(BinOp::Mul, _, _) => Ok("attempt to multiply with overflow"),
281            AssertMessage::Overflow(BinOp::Div, _, _) => Ok("attempt to divide with overflow"),
282            AssertMessage::Overflow(BinOp::Rem, _, _) => {
283                Ok("attempt to calculate the remainder with overflow")
284            }
285            AssertMessage::OverflowNeg(_) => Ok("attempt to negate with overflow"),
286            AssertMessage::Overflow(BinOp::Shr, _, _) => Ok("attempt to shift right with overflow"),
287            AssertMessage::Overflow(BinOp::Shl, _, _) => Ok("attempt to shift left with overflow"),
288            AssertMessage::Overflow(op, _, _) => Err(Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("`{0:?}` cannot overflow", op))
        }))error!("`{:?}` cannot overflow", op)),
289            AssertMessage::DivisionByZero(_) => Ok("attempt to divide by zero"),
290            AssertMessage::RemainderByZero(_) => {
291                Ok("attempt to calculate the remainder with a divisor of zero")
292            }
293            AssertMessage::ResumedAfterReturn(CoroutineKind::Coroutine(_)) => {
294                Ok("coroutine resumed after completion")
295            }
296            AssertMessage::ResumedAfterReturn(CoroutineKind::Desugared(
297                CoroutineDesugaring::Async,
298                _,
299            )) => Ok("`async fn` resumed after completion"),
300            AssertMessage::ResumedAfterReturn(CoroutineKind::Desugared(
301                CoroutineDesugaring::Gen,
302                _,
303            )) => Ok("`async gen fn` resumed after completion"),
304            AssertMessage::ResumedAfterReturn(CoroutineKind::Desugared(
305                CoroutineDesugaring::AsyncGen,
306                _,
307            )) => Ok("`gen fn` should just keep returning `AssertMessage::None` after completion"),
308            AssertMessage::ResumedAfterPanic(CoroutineKind::Coroutine(_)) => {
309                Ok("coroutine resumed after panicking")
310            }
311            AssertMessage::ResumedAfterPanic(CoroutineKind::Desugared(
312                CoroutineDesugaring::Async,
313                _,
314            )) => Ok("`async fn` resumed after panicking"),
315            AssertMessage::ResumedAfterPanic(CoroutineKind::Desugared(
316                CoroutineDesugaring::Gen,
317                _,
318            )) => Ok("`async gen fn` resumed after panicking"),
319            AssertMessage::ResumedAfterPanic(CoroutineKind::Desugared(
320                CoroutineDesugaring::AsyncGen,
321                _,
322            )) => Ok("`gen fn` should just keep returning `AssertMessage::None` after panicking"),
323
324            AssertMessage::ResumedAfterDrop(CoroutineKind::Coroutine(_)) => {
325                Ok("coroutine resumed after async drop")
326            }
327            AssertMessage::ResumedAfterDrop(CoroutineKind::Desugared(
328                CoroutineDesugaring::Async,
329                _,
330            )) => Ok("`async fn` resumed after async drop"),
331            AssertMessage::ResumedAfterDrop(CoroutineKind::Desugared(
332                CoroutineDesugaring::Gen,
333                _,
334            )) => Ok("`async gen fn` resumed after async drop"),
335            AssertMessage::ResumedAfterDrop(CoroutineKind::Desugared(
336                CoroutineDesugaring::AsyncGen,
337                _,
338            )) => Ok("`gen fn` should just keep returning `AssertMessage::None` after async drop"),
339
340            AssertMessage::BoundsCheck { .. } => Ok("index out of bounds"),
341            AssertMessage::MisalignedPointerDereference { .. } => {
342                Ok("misaligned pointer dereference")
343            }
344            AssertMessage::NullPointerDereference => Ok("null pointer dereference occurred"),
345            AssertMessage::InvalidEnumConstruction(_) => {
346                Ok("trying to construct an enum from an invalid value")
347            }
348        }
349    }
350}
351
352#[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_receiver_is_total_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)]
353pub enum BinOp {
354    Add,
355    AddUnchecked,
356    Sub,
357    SubUnchecked,
358    Mul,
359    MulUnchecked,
360    Div,
361    Rem,
362    BitXor,
363    BitAnd,
364    BitOr,
365    Shl,
366    ShlUnchecked,
367    Shr,
368    ShrUnchecked,
369    Eq,
370    Lt,
371    Le,
372    Ne,
373    Ge,
374    Gt,
375    Cmp,
376    Offset,
377}
378
379impl BinOp {
380    /// Return the type of this operation for the given input Ty.
381    /// This function does not perform type checking, and it currently doesn't handle SIMD.
382    pub fn ty(&self, lhs_ty: Ty, rhs_ty: Ty) -> Ty {
383        with(|ctx| ctx.binop_ty(*self, lhs_ty, rhs_ty))
384    }
385}
386
387#[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_receiver_is_total_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)]
388pub enum UnOp {
389    Not,
390    Neg,
391    PtrMetadata,
392}
393
394impl UnOp {
395    /// Return the type of this operation for the given input Ty.
396    /// This function does not perform type checking, and it currently doesn't handle SIMD.
397    pub fn ty(&self, arg_ty: Ty) -> Ty {
398        with(|ctx| ctx.unop_ty(*self, arg_ty))
399    }
400}
401
402#[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_receiver_is_total_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)]
403pub enum CoroutineKind {
404    Desugared(CoroutineDesugaring, CoroutineSource),
405    Coroutine(Movability),
406}
407
408#[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_receiver_is_total_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)]
409pub enum CoroutineSource {
410    Block,
411    Closure,
412    Fn,
413}
414
415#[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_receiver_is_total_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)]
416pub enum CoroutineDesugaring {
417    Async,
418
419    Gen,
420
421    AsyncGen,
422}
423
424pub(crate) type LocalDefId = Opaque;
425/// The rustc coverage data structures are heavily tied to internal details of the
426/// coverage implementation that are likely to change, and are unlikely to be
427/// useful to third-party tools for the foreseeable future.
428pub(crate) type Coverage = Opaque;
429
430/// The FakeReadCause describes the type of pattern why a FakeRead statement exists.
431#[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_receiver_is_total_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)]
432pub enum FakeReadCause {
433    ForMatchGuard,
434    ForMatchedPlace(LocalDefId),
435    ForGuardBinding,
436    ForLet(LocalDefId),
437    ForIndex,
438}
439
440/// Describes what kind of retag is to be performed
441#[derive(#[automatically_derived]
impl ::core::marker::Copy for RetagKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for RetagKind {
    #[inline]
    fn clone(&self) -> RetagKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for RetagKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                RetagKind::FnEntry => "FnEntry",
                RetagKind::TwoPhase => "TwoPhase",
                RetagKind::Raw => "Raw",
                RetagKind::Default => "Default",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for RetagKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for RetagKind {
    #[inline]
    fn eq(&self, other: &RetagKind) -> 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 RetagKind {
    #[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 RetagKind {
            fn serialize<__S>(&self, __serializer: __S)
                -> _serde::__private228::Result<__S::Ok, __S::Error> where
                __S: _serde::Serializer {
                match *self {
                    RetagKind::FnEntry =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RetagKind", 0u32, "FnEntry"),
                    RetagKind::TwoPhase =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RetagKind", 1u32, "TwoPhase"),
                    RetagKind::Raw =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RetagKind", 2u32, "Raw"),
                    RetagKind::Default =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "RetagKind", 3u32, "Default"),
                }
            }
        }
    };Serialize)]
442pub enum RetagKind {
443    FnEntry,
444    TwoPhase,
445    Raw,
446    Default,
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_receiver_is_total_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_receiver_is_total_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_receiver_is_total_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),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}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, "span", &&self.span)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Statement {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<StatementKind>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialEq for Statement {
    #[inline]
    fn eq(&self, other: &Statement) -> bool {
        self.kind == other.kind && self.span == other.span
    }
}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,
                        "span", &self.span)?;
                _serde::ser::SerializeStruct::end(__serde_state)
            }
        }
    };Serialize)]
471pub struct Statement {
472    pub kind: StatementKind,
473    pub span: Span,
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::Retag(__self_0, __self_1) =>
                StatementKind::Retag(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            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::Retag(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Retag",
                    __self_0, &__self_1),
            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_receiver_is_total_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<RetagKind>;
        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::Retag(__self_0, __self_1),
                    StatementKind::Retag(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (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::Retag(ref __field0, ref __field1) => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_tuple_variant(__serializer,
                                    "StatementKind", 5u32, "Retag", 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::PlaceMention(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 6u32, "PlaceMention", __field0),
                    StatementKind::AscribeUserType {
                        ref place, ref projections, ref variance } => {
                        let mut __serde_state =
                            _serde::Serializer::serialize_struct_variant(__serializer,
                                    "StatementKind", 7u32, "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", 8u32, "Coverage", __field0),
                    StatementKind::Intrinsic(ref __field0) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "StatementKind", 9u32, "Intrinsic", __field0),
                    StatementKind::ConstEvalCounter =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "StatementKind", 10u32, "ConstEvalCounter"),
                    StatementKind::Nop =>
                        _serde::Serializer::serialize_unit_variant(__serializer,
                            "StatementKind", 11u32, "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    Retag(RetagKind, Place),
484    PlaceMention(Place),
485    AscribeUserType { place: Place, projections: UserTypeProjection, variance: Variance },
486    Coverage(Coverage),
487    Intrinsic(NonDivergingIntrinsic),
488    ConstEvalCounter,
489    Nop,
490}
491
492#[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) =>
                Rvalue::Use(::core::clone::Clone::clone(__self_0)),
        }
    }
}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) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Use",
                    &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Rvalue {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_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>;
    }
}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), Rvalue::Use(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => 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) =>
                ::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 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) =>
                        _serde::Serializer::serialize_newtype_variant(__serializer,
                            "Rvalue", 12u32, "Use", __field0),
                }
            }
        }
    };Serialize)]
493pub enum Rvalue {
494    /// Creates a pointer with the indicated mutability to the place.
495    ///
496    /// This is generated by pointer casts like `&v as *const _` or raw address of expressions like
497    /// `&raw v` or `addr_of!(v)`.
498    AddressOf(RawPtrKind, Place),
499
500    /// Creates an aggregate value, like a tuple or struct.
501    ///
502    /// This is needed because dataflow analysis needs to distinguish
503    /// `dest = Foo { x: ..., y: ... }` from `dest.x = ...; dest.y = ...;` in the case that `Foo`
504    /// has a destructor.
505    ///
506    /// Disallowed after deaggregation for all aggregate kinds except `Array` and `Coroutine`. After
507    /// coroutine lowering, `Coroutine` aggregate kinds are disallowed too.
508    Aggregate(AggregateKind, Vec<Operand>),
509
510    /// * `Offset` has the same semantics as `<*const T>::offset`, except that the second
511    ///   parameter may be a `usize` as well.
512    /// * The comparison operations accept `bool`s, `char`s, signed or unsigned integers, floats,
513    ///   raw pointers, or function pointers and return a `bool`. The types of the operands must be
514    ///   matching, up to the usual caveat of the lifetimes in function pointers.
515    /// * Left and right shift operations accept signed or unsigned integers not necessarily of the
516    ///   same type and return a value of the same type as their LHS. Like in Rust, the RHS is
517    ///   truncated as needed.
518    /// * The `Bit*` operations accept signed integers, unsigned integers, or bools with matching
519    ///   types and return a value of that type.
520    /// * The remaining operations accept signed integers, unsigned integers, or floats with
521    ///   matching types and return a value of that type.
522    BinaryOp(BinOp, Operand, Operand),
523
524    /// Performs essentially all of the casts that can be performed via `as`.
525    ///
526    /// This allows for casts from/to a variety of types.
527    Cast(CastKind, Operand, Ty),
528
529    /// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition.
530    ///
531    /// For addition, subtraction, and multiplication on integers the error condition is set when
532    /// the infinite precision result would not be equal to the actual result.
533    CheckedBinaryOp(BinOp, Operand, Operand),
534
535    /// A CopyForDeref is equivalent to a read from a place.
536    /// When such a read happens, it is guaranteed that the only use of the returned value is a
537    /// deref operation, immediately followed by one or more projections.
538    CopyForDeref(Place),
539
540    /// Computes the discriminant of the place, returning it as an integer.
541    /// Returns zero for types without discriminant.
542    ///
543    /// The validity requirements for the underlying value are undecided for this rvalue, see
544    /// [#91095]. Note too that the value of the discriminant is not the same thing as the
545    /// variant index;
546    ///
547    /// [#91095]: https://github.com/rust-lang/rust/issues/91095
548    Discriminant(Place),
549
550    /// Yields the length of the place, as a `usize`.
551    ///
552    /// If the type of the place is an array, this is the array length. For slices (`[T]`, not
553    /// `&[T]`) this accesses the place's metadata to determine the length. This rvalue is
554    /// ill-formed for places of other types.
555    Len(Place),
556
557    /// Creates a reference to the place.
558    Ref(Region, BorrowKind, Place),
559
560    /// Creates an array where each element is the value of the operand.
561    ///
562    /// This is the cause of a bug in the case where the repetition count is zero because the value
563    /// is not dropped, see [#74836].
564    ///
565    /// Corresponds to source code like `[x; 32]`.
566    ///
567    /// [#74836]: https://github.com/rust-lang/rust/issues/74836
568    Repeat(Operand, TyConst),
569
570    /// Creates a pointer/reference to the given thread local.
571    ///
572    /// The yielded type is a `*mut T` if the static is mutable, otherwise if the static is extern a
573    /// `*const T`, and if neither of those apply a `&T`.
574    ///
575    /// **Note:** This is a runtime operation that actually executes code and is in this sense more
576    /// like a function call. Also, eliminating dead stores of this rvalue causes `fn main() {}` to
577    /// SIGILL for some reason that I (JakobDegen) never got a chance to look into.
578    ///
579    /// **Needs clarification**: Are there weird additional semantics here related to the runtime
580    /// nature of this operation?
581    ThreadLocalRef(crate::CrateItem),
582
583    /// Exactly like `BinaryOp`, but less operands.
584    ///
585    /// Also does two's-complement arithmetic. Negation requires a signed integer or a float;
586    /// bitwise not requires a signed integer, unsigned integer, or bool. Both operation kinds
587    /// return a value with the same type as their operand.
588    UnaryOp(UnOp, Operand),
589
590    /// Yields the operand unchanged
591    Use(Operand),
592}
593
594impl Rvalue {
595    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
596        match self {
597            Rvalue::Use(operand) => operand.ty(locals),
598            Rvalue::Repeat(operand, count) => {
599                Ok(Ty::new_array_with_const_len(operand.ty(locals)?, count.clone()))
600            }
601            Rvalue::ThreadLocalRef(did) => Ok(did.ty()),
602            Rvalue::Ref(reg, bk, place) => {
603                let place_ty = place.ty(locals)?;
604                Ok(Ty::new_ref(reg.clone(), place_ty, bk.to_mutable_lossy()))
605            }
606            Rvalue::AddressOf(mutability, place) => {
607                let place_ty = place.ty(locals)?;
608                Ok(Ty::new_ptr(place_ty, mutability.to_mutable_lossy()))
609            }
610            Rvalue::Len(..) => Ok(Ty::usize_ty()),
611            Rvalue::Cast(.., ty) => Ok(*ty),
612            Rvalue::BinaryOp(op, lhs, rhs) => {
613                let lhs_ty = lhs.ty(locals)?;
614                let rhs_ty = rhs.ty(locals)?;
615                Ok(op.ty(lhs_ty, rhs_ty))
616            }
617            Rvalue::CheckedBinaryOp(op, lhs, rhs) => {
618                let lhs_ty = lhs.ty(locals)?;
619                let rhs_ty = rhs.ty(locals)?;
620                let ty = op.ty(lhs_ty, rhs_ty);
621                Ok(Ty::new_tuple(&[ty, Ty::bool_ty()]))
622            }
623            Rvalue::UnaryOp(op, operand) => {
624                let arg_ty = operand.ty(locals)?;
625                Ok(op.ty(arg_ty))
626            }
627            Rvalue::Discriminant(place) => {
628                let place_ty = place.ty(locals)?;
629                place_ty
630                    .kind()
631                    .discriminant_ty()
632                    .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:?}"))
633            }
634            Rvalue::Aggregate(ak, ops) => match *ak {
635                AggregateKind::Array(ty) => Ty::try_new_array(ty, ops.len() as u64),
636                AggregateKind::Tuple => Ok(Ty::new_tuple(
637                    &ops.iter().map(|op| op.ty(locals)).collect::<Result<Vec<_>, _>>()?,
638                )),
639                AggregateKind::Adt(def, _, ref args, _, _) => Ok(def.ty_with_args(args)),
640                AggregateKind::Closure(def, ref args) => Ok(Ty::new_closure(def, args.clone())),
641                AggregateKind::Coroutine(def, ref args) => Ok(Ty::new_coroutine(def, args.clone())),
642                AggregateKind::CoroutineClosure(def, ref args) => {
643                    Ok(Ty::new_coroutine_closure(def, args.clone()))
644                }
645                AggregateKind::RawPtr(ty, mutability) => Ok(Ty::new_ptr(ty, mutability)),
646            },
647            Rvalue::CopyForDeref(place) => place.ty(locals),
648        }
649    }
650}
651
652#[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_receiver_is_total_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)]
653pub enum AggregateKind {
654    Array(Ty),
655    Tuple,
656    Adt(AdtDef, VariantIdx, GenericArgs, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
657    Closure(ClosureDef, GenericArgs),
658    Coroutine(CoroutineDef, GenericArgs),
659    CoroutineClosure(CoroutineClosureDef, GenericArgs),
660    RawPtr(Ty, Mutability),
661}
662
663#[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_receiver_is_total_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)]
664pub enum Operand {
665    Copy(Place),
666    Move(Place),
667    Constant(ConstOperand),
668    RuntimeChecks(RuntimeChecks),
669}
670
671#[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_receiver_is_total_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)]
672pub struct Place {
673    pub local: Local,
674    /// projection out of a place (access a field, deref a pointer, etc)
675    pub projection: Vec<ProjectionElem>,
676}
677
678impl From<Local> for Place {
679    fn from(local: Local) -> Self {
680        Place { local, projection: ::alloc::vec::Vec::new()vec![] }
681    }
682}
683
684#[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_receiver_is_total_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)]
685pub struct ConstOperand {
686    pub span: Span,
687    pub user_ty: Option<UserTypeAnnotationIndex>,
688    pub const_: MirConst,
689}
690
691#[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_receiver_is_total_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)]
692pub enum RuntimeChecks {
693    /// cfg!(ub_checks), but at codegen time
694    UbChecks,
695    /// cfg!(contract_checks), but at codegen time
696    ContractChecks,
697    /// cfg!(overflow_checks), but at codegen time
698    OverflowChecks,
699}
700
701/// Debug information pertaining to a user variable.
702#[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_receiver_is_total_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)]
703pub struct VarDebugInfo {
704    /// The variable name.
705    pub name: Symbol,
706
707    /// Source info of the user variable, including the scope
708    /// within which the variable is visible (to debuginfo).
709    pub source_info: SourceInfo,
710
711    /// The user variable's data is split across several fragments,
712    /// each described by a `VarDebugInfoFragment`.
713    pub composite: Option<VarDebugInfoFragment>,
714
715    /// Where the data for this user variable is to be found.
716    pub value: VarDebugInfoContents,
717
718    /// When present, indicates what argument number this variable is in the function that it
719    /// originated from (starting from 1). Note, if MIR inlining is enabled, then this is the
720    /// argument number in the original function before it was inlined.
721    pub argument_index: Option<u16>,
722}
723
724impl VarDebugInfo {
725    /// Return a local variable if this info is related to one.
726    pub fn local(&self) -> Option<Local> {
727        match &self.value {
728            VarDebugInfoContents::Place(place) if place.projection.is_empty() => Some(place.local),
729            VarDebugInfoContents::Place(_) | VarDebugInfoContents::Const(_) => None,
730        }
731    }
732
733    /// Return a constant if this info is related to one.
734    pub fn constant(&self) -> Option<&ConstOperand> {
735        match &self.value {
736            VarDebugInfoContents::Place(_) => None,
737            VarDebugInfoContents::Const(const_op) => Some(const_op),
738        }
739    }
740}
741
742pub type SourceScope = u32;
743
744#[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_receiver_is_total_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)]
745pub struct SourceInfo {
746    pub span: Span,
747    pub scope: SourceScope,
748}
749
750#[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_receiver_is_total_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)]
751pub struct VarDebugInfoFragment {
752    pub ty: Ty,
753    pub projection: Vec<ProjectionElem>,
754}
755
756#[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_receiver_is_total_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)]
757pub enum VarDebugInfoContents {
758    Place(Place),
759    Const(ConstOperand),
760}
761
762// In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This
763// is so it can be used for both Places (for which the projection elements are of type
764// ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements
765// are of type ProjectionElem<(), ()>).
766// In rustc_public's IR we don't need this generality, so we just use ProjectionElem for Places.
767#[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_receiver_is_total_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)]
768pub enum ProjectionElem {
769    /// Dereference projections (e.g. `*_1`) project to the address referenced by the base place.
770    Deref,
771
772    /// A field projection (e.g., `f` in `_1.f`) project to a field in the base place. The field is
773    /// referenced by source-order index rather than the name of the field. The fields type is also
774    /// given.
775    Field(FieldIdx, Ty),
776
777    /// Index into a slice/array. The value of the index is computed at runtime using the `V`
778    /// argument.
779    ///
780    /// Note that this does not also dereference, and so it does not exactly correspond to slice
781    /// indexing in Rust. In other words, in the below Rust code:
782    ///
783    /// ```rust
784    /// let x = &[1, 2, 3, 4];
785    /// let i = 2;
786    /// x[i];
787    /// ```
788    ///
789    /// The `x[i]` is turned into a `Deref` followed by an `Index`, not just an `Index`. The same
790    /// thing is true of the `ConstantIndex` and `Subslice` projections below.
791    Index(Local),
792
793    /// Index into a slice/array given by offsets.
794    ///
795    /// These indices are generated by slice patterns. Easiest to explain by example:
796    ///
797    /// ```ignore (illustrative)
798    /// [X, _, .._, _, _] => { offset: 0, min_length: 4, from_end: false },
799    /// [_, X, .._, _, _] => { offset: 1, min_length: 4, from_end: false },
800    /// [_, _, .._, X, _] => { offset: 2, min_length: 4, from_end: true },
801    /// [_, _, .._, _, X] => { offset: 1, min_length: 4, from_end: true },
802    /// ```
803    ConstantIndex {
804        /// index or -index (in Python terms), depending on from_end
805        offset: u64,
806        /// The thing being indexed must be at least this long -- otherwise, the
807        /// projection is UB.
808        ///
809        /// For arrays this is always the exact length.
810        min_length: u64,
811        /// Counting backwards from end? This is always false when indexing an
812        /// array.
813        from_end: bool,
814    },
815
816    /// Projects a slice from the base place.
817    ///
818    /// These indices are generated by slice patterns. If `from_end` is true, this represents
819    /// `slice[from..slice.len() - to]`. Otherwise it represents `array[from..to]`.
820    Subslice {
821        from: u64,
822        to: u64,
823        /// Whether `to` counts from the start or end of the array/slice.
824        from_end: bool,
825    },
826
827    /// "Downcast" to a variant of an enum or a coroutine.
828    Downcast(VariantIdx),
829
830    /// Like an explicit cast from an opaque type to a concrete type, but without
831    /// requiring an intermediate variable.
832    OpaqueCast(Ty),
833}
834
835#[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_receiver_is_total_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)]
836pub struct UserTypeProjection {
837    pub base: UserTypeAnnotationIndex,
838
839    pub projection: Opaque,
840}
841
842pub type Local = usize;
843
844pub const RETURN_LOCAL: Local = 0;
845
846/// The source-order index of a field in a variant.
847///
848/// For example, in the following types,
849/// ```ignore(illustrative)
850/// enum Demo1 {
851///    Variant0 { a: bool, b: i32 },
852///    Variant1 { c: u8, d: u64 },
853/// }
854/// struct Demo2 { e: u8, f: u16, g: u8 }
855/// ```
856/// `a`'s `FieldIdx` is `0`,
857/// `b`'s `FieldIdx` is `1`,
858/// `c`'s `FieldIdx` is `0`, and
859/// `g`'s `FieldIdx` is `2`.
860pub type FieldIdx = usize;
861
862type UserTypeAnnotationIndex = usize;
863
864/// The possible branch sites of a [TerminatorKind::SwitchInt].
865#[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_receiver_is_total_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)]
866pub struct SwitchTargets {
867    /// The conditional branches where the first element represents the value that guards this
868    /// branch, and the second element is the branch target.
869    branches: Vec<(u128, BasicBlockIdx)>,
870    /// The `otherwise` branch which will be taken in case none of the conditional branches are
871    /// satisfied.
872    otherwise: BasicBlockIdx,
873}
874
875impl SwitchTargets {
876    /// All possible targets including the `otherwise` target.
877    pub fn all_targets(&self) -> Successors {
878        self.branches.iter().map(|(_, target)| *target).chain(Some(self.otherwise)).collect()
879    }
880
881    /// The `otherwise` branch target.
882    pub fn otherwise(&self) -> BasicBlockIdx {
883        self.otherwise
884    }
885
886    /// The conditional targets which are only taken if the pattern matches the given value.
887    pub fn branches(&self) -> impl Iterator<Item = (u128, BasicBlockIdx)> {
888        self.branches.iter().copied()
889    }
890
891    /// The number of targets including `otherwise`.
892    pub fn len(&self) -> usize {
893        self.branches.len() + 1
894    }
895
896    /// Create a new SwitchTargets from the given branches and `otherwise` target.
897    pub fn new(branches: Vec<(u128, BasicBlockIdx)>, otherwise: BasicBlockIdx) -> SwitchTargets {
898        SwitchTargets { branches, otherwise }
899    }
900}
901
902#[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_receiver_is_total_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)]
903pub enum BorrowKind {
904    /// Data must be immutable and is aliasable.
905    Shared,
906
907    /// An immutable, aliasable borrow that is discarded after borrow-checking. Can behave either
908    /// like a normal shared borrow or like a special shallow borrow (see [`FakeBorrowKind`]).
909    Fake(FakeBorrowKind),
910
911    /// Data is mutable and not aliasable.
912    Mut {
913        /// `true` if this borrow arose from method-call auto-ref
914        kind: MutBorrowKind,
915    },
916}
917
918impl BorrowKind {
919    pub fn to_mutable_lossy(self) -> Mutability {
920        match self {
921            BorrowKind::Mut { .. } => Mutability::Mut,
922            BorrowKind::Shared => Mutability::Not,
923            // FIXME: There's no type corresponding to a shallow borrow, so use `&` as an approximation.
924            BorrowKind::Fake(_) => Mutability::Not,
925        }
926    }
927}
928
929#[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_receiver_is_total_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)]
930pub enum RawPtrKind {
931    Mut,
932    Const,
933    FakeForPtrMetadata,
934}
935
936impl RawPtrKind {
937    pub fn to_mutable_lossy(self) -> Mutability {
938        match self {
939            RawPtrKind::Mut { .. } => Mutability::Mut,
940            RawPtrKind::Const => Mutability::Not,
941            // FIXME: There's no type corresponding to a shallow borrow, so use `&` as an approximation.
942            RawPtrKind::FakeForPtrMetadata => Mutability::Not,
943        }
944    }
945}
946
947#[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_receiver_is_total_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)]
948pub enum MutBorrowKind {
949    Default,
950    TwoPhaseBorrow,
951    ClosureCapture,
952}
953
954#[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_receiver_is_total_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)]
955pub enum FakeBorrowKind {
956    /// A shared (deep) borrow. Data must be immutable and is aliasable.
957    Deep,
958    /// The immediately borrowed place must be immutable, but projections from
959    /// it don't need to be. This is used to prevent match guards from replacing
960    /// the scrutinee. For example, a fake borrow of `a.b` doesn't
961    /// conflict with a mutable borrow of `a.b.c`.
962    Shallow,
963}
964
965#[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_receiver_is_total_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)]
966pub enum Mutability {
967    Not,
968    Mut,
969}
970
971#[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_receiver_is_total_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)]
972pub enum Safety {
973    Safe,
974    Unsafe,
975}
976
977#[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_receiver_is_total_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)]
978pub enum PointerCoercion {
979    /// Go from a fn-item type to a fn-pointer type.
980    ReifyFnPointer(Safety),
981
982    /// Go from a safe fn pointer to an unsafe fn pointer.
983    UnsafeFnPointer,
984
985    /// Go from a non-capturing closure to a fn pointer or an unsafe fn pointer.
986    /// It cannot convert a closure that requires unsafe.
987    ClosureFnPointer(Safety),
988
989    /// Go from a mut raw pointer to a const raw pointer.
990    MutToConstPointer,
991
992    /// Go from `*const [T; N]` to `*const T`
993    ArrayToPointer,
994
995    /// Unsize a pointer/reference value, e.g., `&[T; n]` to
996    /// `&[T]`. Note that the source could be a thin or wide pointer.
997    /// This will do things like convert thin pointers to wide
998    /// pointers, or convert structs containing thin pointers to
999    /// structs containing wide pointers, or convert between wide
1000    /// pointers.
1001    Unsize,
1002}
1003
1004#[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_receiver_is_total_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)]
1005pub enum CastKind {
1006    // FIXME(smir-rename): rename this to PointerExposeProvenance
1007    PointerExposeAddress,
1008    PointerWithExposedProvenance,
1009    PointerCoercion(PointerCoercion),
1010    IntToInt,
1011    FloatToInt,
1012    FloatToFloat,
1013    IntToFloat,
1014    PtrToPtr,
1015    FnPtrToPtr,
1016    Transmute,
1017    Subtype,
1018}
1019
1020impl Operand {
1021    /// Get the type of an operand relative to the local declaration.
1022    ///
1023    /// In order to retrieve the correct type, the `locals` argument must match the list of all
1024    /// locals from the function body where this operand originates from.
1025    ///
1026    /// Errors indicate a malformed operand or incompatible locals list.
1027    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
1028        match self {
1029            Operand::Copy(place) | Operand::Move(place) => place.ty(locals),
1030            Operand::Constant(c) => Ok(c.ty()),
1031            Operand::RuntimeChecks(_) => Ok(Ty::bool_ty()),
1032        }
1033    }
1034}
1035
1036impl ConstOperand {
1037    pub fn ty(&self) -> Ty {
1038        self.const_.ty()
1039    }
1040}
1041
1042impl Place {
1043    /// Resolve down the chain of projections to get the type referenced at the end of it.
1044    /// E.g.:
1045    /// Calling `ty()` on `var.field` should return the type of `field`.
1046    ///
1047    /// In order to retrieve the correct type, the `locals` argument must match the list of all
1048    /// locals from the function body where this place originates from.
1049    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
1050        self.projection.iter().try_fold(locals[self.local].ty, |place_ty, elem| elem.ty(place_ty))
1051    }
1052}
1053
1054impl ProjectionElem {
1055    /// Get the expected type after applying this projection to a given place type.
1056    pub fn ty(&self, place_ty: Ty) -> Result<Ty, Error> {
1057        let ty = place_ty;
1058        match &self {
1059            ProjectionElem::Deref => Self::deref_ty(ty),
1060            ProjectionElem::Field(_idx, fty) => Ok(*fty),
1061            ProjectionElem::Index(_) | ProjectionElem::ConstantIndex { .. } => Self::index_ty(ty),
1062            ProjectionElem::Subslice { from, to, from_end } => {
1063                Self::subslice_ty(ty, *from, *to, *from_end)
1064            }
1065            ProjectionElem::Downcast(_) => Ok(ty),
1066            ProjectionElem::OpaqueCast(ty) => Ok(*ty),
1067        }
1068    }
1069
1070    fn index_ty(ty: Ty) -> Result<Ty, Error> {
1071        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:?}"))
1072    }
1073
1074    fn subslice_ty(ty: Ty, from: u64, to: u64, from_end: bool) -> Result<Ty, Error> {
1075        let ty_kind = ty.kind();
1076        match ty_kind {
1077            TyKind::RigidTy(RigidTy::Slice(..)) => Ok(ty),
1078            TyKind::RigidTy(RigidTy::Array(inner, _)) if !from_end => Ty::try_new_array(
1079                inner,
1080                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}"))?,
1081            ),
1082            TyKind::RigidTy(RigidTy::Array(inner, size)) => {
1083                let size = size.eval_target_usize()?;
1084                let len = size - from - to;
1085                Ty::try_new_array(inner, len)
1086            }
1087            _ => 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:?}`"))),
1088        }
1089    }
1090
1091    fn deref_ty(ty: Ty) -> Result<Ty, Error> {
1092        let deref_ty = ty
1093            .kind()
1094            .builtin_deref(true)
1095            .ok_or_else(|| Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("Cannot dereference type: {0:?}",
                    ty))
        }))error!("Cannot dereference type: {ty:?}"))?;
1096        Ok(deref_ty.ty)
1097    }
1098}