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