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) -> Self {
        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 _ =
            "Body 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, 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_global(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) -> Self {
        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 span mutability", &self.ty, &self.span,
            &&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::marker::StructuralPartialEq for LocalDecl
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for LocalDecl {
    #[inline]
    fn eq(&self, other: &Self) -> 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) -> Self {
        BasicBlock {
            statements: ::core::clone::Clone::clone(&self.statements),
            terminator: ::core::clone::Clone::clone(&self.terminator),
        }
    }
}Clone, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    BasicBlock {
}
#[automatically_derived]impl ::core::cmp::PartialEq for BasicBlock {
    #[inline]
    fn eq(&self, other: &Self) -> 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 terminator", &self.statements,
            &&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) -> Self {
        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 source_info", &self.kind, &&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::marker::StructuralPartialEq for
    Terminator {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Terminator {
    #[inline]
    fn eq(&self, other: &Self) -> 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) -> Self {
        match self {
            Self::Goto { target: __self_0 } =>
                TerminatorKind::Goto {
                    target: ::core::clone::Clone::clone(__self_0),
                },
            Self::SwitchInt { discr: __self_0, targets: __self_1 } =>
                TerminatorKind::SwitchInt {
                    discr: ::core::clone::Clone::clone(__self_0),
                    targets: ::core::clone::Clone::clone(__self_1),
                },
            Self::Resume => TerminatorKind::Resume,
            Self::Abort => TerminatorKind::Abort,
            Self::Return => TerminatorKind::Return,
            Self::Unreachable => TerminatorKind::Unreachable,
            Self::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),
                },
            Self::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),
                },
            Self::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),
                },
            Self::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 {
            Self::Goto { target: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Goto target", &__self_0),
            Self::SwitchInt { discr: __self_0, targets: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "SwitchInt discr targets", __self_0, &__self_1),
            Self::Resume => ::core::fmt::Formatter::write_str(f, "Resume"),
            Self::Abort => ::core::fmt::Formatter::write_str(f, "Abort"),
            Self::Return => ::core::fmt::Formatter::write_str(f, "Return"),
            Self::Unreachable =>
                ::core::fmt::Formatter::write_str(f, "Unreachable"),
            Self::Drop { place: __self_0, target: __self_1, unwind: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Drop place target unwind", __self_0, __self_1, &__self_2),
            Self::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 args destination target unwind", __self_0,
                    __self_1, __self_2, __self_3, &__self_4),
            Self::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 expected msg target unwind", __self_0,
                    __self_1, __self_2, __self_3, &__self_4),
            Self::InlineAsm {
                template: __self_0,
                operands: __self_1,
                options: __self_2,
                line_spans: __self_3,
                destination: __self_4,
                unwind: __self_5 } => {
                let names: &'static _ =
                    "InlineAsm 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, 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::marker::StructuralPartialEq for
    TerminatorKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for TerminatorKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Goto { target: __self_0 }, Self::Goto {
                    target: __arg1_0 }) => __self_0 == __arg1_0,
                (Self::SwitchInt { discr: __self_0, targets: __self_1 },
                    Self::SwitchInt { discr: __arg1_0, targets: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Drop {
                    place: __self_0, target: __self_1, unwind: __self_2 },
                    Self::Drop {
                    place: __arg1_0, target: __arg1_1, unwind: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::Call {
                    func: __self_0,
                    args: __self_1,
                    destination: __self_2,
                    target: __self_3,
                    unwind: __self_4 }, Self::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,
                (Self::Assert {
                    cond: __self_0,
                    expected: __self_1,
                    msg: __self_2,
                    target: __self_3,
                    unwind: __self_4 }, Self::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,
                (Self::InlineAsm {
                    template: __self_0,
                    operands: __self_1,
                    options: __self_2,
                    line_spans: __self_3,
                    destination: __self_4,
                    unwind: __self_5 }, Self::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) -> Self {
        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 out_place raw_rpr", &self.in_value,
            &self.out_place, &&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::marker::StructuralPartialEq for
    InlineAsmOperand {
}
#[automatically_derived]impl ::core::cmp::PartialEq for InlineAsmOperand {
    #[inline]
    fn eq(&self, other: &Self) -> 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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for UnwindAction {
}
#[automatically_derived]impl ::core::clone::Clone for UnwindAction {
    #[inline]
    fn clone(&self) -> Self {
        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 {
            Self::Continue =>
                ::core::fmt::Formatter::write_str(f, "Continue"),
            Self::Unreachable =>
                ::core::fmt::Formatter::write_str(f, "Unreachable"),
            Self::Terminate =>
                ::core::fmt::Formatter::write_str(f, "Terminate"),
            Self::Cleanup(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    UnwindAction {
}
#[automatically_derived]impl ::core::cmp::PartialEq for UnwindAction {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Cleanup(__self_0), Self::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) -> Self {
        match self {
            Self::BoundsCheck { len: __self_0, index: __self_1 } =>
                AssertMessage::BoundsCheck {
                    len: ::core::clone::Clone::clone(__self_0),
                    index: ::core::clone::Clone::clone(__self_1),
                },
            Self::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)),
            Self::OverflowNeg(__self_0) =>
                AssertMessage::OverflowNeg(::core::clone::Clone::clone(__self_0)),
            Self::DivisionByZero(__self_0) =>
                AssertMessage::DivisionByZero(::core::clone::Clone::clone(__self_0)),
            Self::RemainderByZero(__self_0) =>
                AssertMessage::RemainderByZero(::core::clone::Clone::clone(__self_0)),
            Self::ResumedAfterReturn(__self_0) =>
                AssertMessage::ResumedAfterReturn(::core::clone::Clone::clone(__self_0)),
            Self::ResumedAfterPanic(__self_0) =>
                AssertMessage::ResumedAfterPanic(::core::clone::Clone::clone(__self_0)),
            Self::ResumedAfterDrop(__self_0) =>
                AssertMessage::ResumedAfterDrop(::core::clone::Clone::clone(__self_0)),
            Self::MisalignedPointerDereference {
                required: __self_0, found: __self_1 } =>
                AssertMessage::MisalignedPointerDereference {
                    required: ::core::clone::Clone::clone(__self_0),
                    found: ::core::clone::Clone::clone(__self_1),
                },
            Self::NullPointerDereference =>
                AssertMessage::NullPointerDereference,
            Self::NullReferenceConstructed =>
                AssertMessage::NullReferenceConstructed,
            Self::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 {
            Self::BoundsCheck { len: __self_0, index: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "BoundsCheck len index", __self_0, &__self_1),
            Self::Overflow(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Overflow", __self_0, __self_1, &__self_2),
            Self::OverflowNeg(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "OverflowNeg", &__self_0),
            Self::DivisionByZero(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "DivisionByZero", &__self_0),
            Self::RemainderByZero(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "RemainderByZero", &__self_0),
            Self::ResumedAfterReturn(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ResumedAfterReturn", &__self_0),
            Self::ResumedAfterPanic(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ResumedAfterPanic", &__self_0),
            Self::ResumedAfterDrop(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ResumedAfterDrop", &__self_0),
            Self::MisalignedPointerDereference {
                required: __self_0, found: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "MisalignedPointerDereference required found", __self_0,
                    &__self_1),
            Self::NullPointerDereference =>
                ::core::fmt::Formatter::write_str(f,
                    "NullPointerDereference"),
            Self::NullReferenceConstructed =>
                ::core::fmt::Formatter::write_str(f,
                    "NullReferenceConstructed"),
            Self::InvalidEnumConstruction(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    AssertMessage {
}
#[automatically_derived]impl ::core::cmp::PartialEq for AssertMessage {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::BoundsCheck { len: __self_0, index: __self_1 },
                    Self::BoundsCheck { len: __arg1_0, index: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Overflow(__self_0, __self_1, __self_2),
                    Self::Overflow(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::OverflowNeg(__self_0), Self::OverflowNeg(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::DivisionByZero(__self_0),
                    Self::DivisionByZero(__arg1_0)) => __self_0 == __arg1_0,
                (Self::RemainderByZero(__self_0),
                    Self::RemainderByZero(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ResumedAfterReturn(__self_0),
                    Self::ResumedAfterReturn(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ResumedAfterPanic(__self_0),
                    Self::ResumedAfterPanic(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ResumedAfterDrop(__self_0),
                    Self::ResumedAfterDrop(__arg1_0)) => __self_0 == __arg1_0,
                (Self::MisalignedPointerDereference {
                    required: __self_0, found: __self_1 },
                    Self::MisalignedPointerDereference {
                    required: __arg1_0, found: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::InvalidEnumConstruction(__self_0),
                    Self::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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for BinOp {
}
#[automatically_derived]impl ::core::clone::Clone for BinOp {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for BinOp {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_c_like_enum_write_str(f,
            "Add AddUnchecked Sub SubUnchecked Mul MulUnchecked Div Rem BitXor BitAnd BitOr Shl ShlUnchecked Shr ShrUnchecked Eq Lt Le Ne Ge Gt Cmp Offset",
            match self {
                BinOp::Add => 0usize,
                BinOp::AddUnchecked => 4usize,
                BinOp::Sub => 17usize,
                BinOp::SubUnchecked => 21usize,
                BinOp::Mul => 34usize,
                BinOp::MulUnchecked => 38usize,
                BinOp::Div => 51usize,
                BinOp::Rem => 55usize,
                BinOp::BitXor => 59usize,
                BinOp::BitAnd => 66usize,
                BinOp::BitOr => 73usize,
                BinOp::Shl => 79usize,
                BinOp::ShlUnchecked => 83usize,
                BinOp::Shr => 96usize,
                BinOp::ShrUnchecked => 100usize,
                BinOp::Eq => 113usize,
                BinOp::Lt => 116usize,
                BinOp::Le => 119usize,
                BinOp::Ne => 122usize,
                BinOp::Ge => 125usize,
                BinOp::Gt => 128usize,
                BinOp::Cmp => 131usize,
                BinOp::Offset => 135usize,
            })
    }
}Debug, #[automatically_derived]impl ::core::cmp::Eq for BinOp { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for BinOp { }
#[automatically_derived]impl ::core::cmp::PartialEq for BinOp {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for BinOp {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for UnOp {
}
#[automatically_derived]impl ::core::clone::Clone for UnOp {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for UnOp { }
#[automatically_derived]impl ::core::cmp::PartialEq for UnOp {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for UnOp {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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) -> Self {
        match self {
            Self::Desugared(__self_0, __self_1) =>
                CoroutineKind::Desugared(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::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 {
            Self::Desugared(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Desugared", __self_0, &__self_1),
            Self::Coroutine(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    CoroutineKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CoroutineKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Desugared(__self_0, __self_1),
                    Self::Desugared(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Coroutine(__self_0), Self::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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CoroutineSource {
}
#[automatically_derived]impl ::core::clone::Clone for CoroutineSource {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    CoroutineSource {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CoroutineSource {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CoroutineDesugaring {
}
#[automatically_derived]impl ::core::clone::Clone for CoroutineDesugaring {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    CoroutineDesugaring {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CoroutineDesugaring {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}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) -> Self {
        match self {
            Self::ForMatchGuard => FakeReadCause::ForMatchGuard,
            Self::ForMatchedPlace(__self_0) =>
                FakeReadCause::ForMatchedPlace(::core::clone::Clone::clone(__self_0)),
            Self::ForGuardBinding => FakeReadCause::ForGuardBinding,
            Self::ForLet(__self_0) =>
                FakeReadCause::ForLet(::core::clone::Clone::clone(__self_0)),
            Self::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 {
            Self::ForMatchGuard =>
                ::core::fmt::Formatter::write_str(f, "ForMatchGuard"),
            Self::ForMatchedPlace(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ForMatchedPlace", &__self_0),
            Self::ForGuardBinding =>
                ::core::fmt::Formatter::write_str(f, "ForGuardBinding"),
            Self::ForLet(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ForLet", &__self_0),
            Self::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::marker::StructuralPartialEq for
    FakeReadCause {
}
#[automatically_derived]impl ::core::cmp::PartialEq for FakeReadCause {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::ForMatchedPlace(__self_0),
                    Self::ForMatchedPlace(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ForLet(__self_0), Self::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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for WithRetag {
}
#[automatically_derived]impl ::core::clone::Clone for WithRetag {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for WithRetag
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for WithRetag {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for WithRetag {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Variance {
}
#[automatically_derived]impl ::core::clone::Clone for Variance {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for Variance
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Variance {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for Variance {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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) -> Self {
        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 dst count", &self.src, &self.dst,
            &&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::marker::StructuralPartialEq for
    CopyNonOverlapping {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CopyNonOverlapping {
    #[inline]
    fn eq(&self, other: &Self) -> 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) -> Self {
        match self {
            Self::Assume(__self_0) =>
                NonDivergingIntrinsic::Assume(::core::clone::Clone::clone(__self_0)),
            Self::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 {
            Self::Assume(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Assume", &__self_0),
            Self::CopyNonOverlapping(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    NonDivergingIntrinsic {
}
#[automatically_derived]impl ::core::cmp::PartialEq for NonDivergingIntrinsic
    {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Assume(__self_0), Self::Assume(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CopyNonOverlapping(__self_0),
                    Self::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) -> Self {
        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 source_info", &self.kind, &&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::marker::StructuralPartialEq for Statement
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Statement {
    #[inline]
    fn eq(&self, other: &Self) -> 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) -> Self {
        match self {
            Self::Assign(__self_0, __self_1) =>
                StatementKind::Assign(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::FakeRead(__self_0, __self_1) =>
                StatementKind::FakeRead(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::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),
                },
            Self::StorageLive(__self_0) =>
                StatementKind::StorageLive(::core::clone::Clone::clone(__self_0)),
            Self::StorageDead(__self_0) =>
                StatementKind::StorageDead(::core::clone::Clone::clone(__self_0)),
            Self::PlaceMention(__self_0) =>
                StatementKind::PlaceMention(::core::clone::Clone::clone(__self_0)),
            Self::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),
                },
            Self::Coverage(__self_0) =>
                StatementKind::Coverage(::core::clone::Clone::clone(__self_0)),
            Self::Intrinsic(__self_0) =>
                StatementKind::Intrinsic(::core::clone::Clone::clone(__self_0)),
            Self::ConstEvalCounter => StatementKind::ConstEvalCounter,
            Self::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 {
            Self::Assign(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Assign", __self_0, &__self_1),
            Self::FakeRead(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "FakeRead", __self_0, &__self_1),
            Self::SetDiscriminant { place: __self_0, variant_index: __self_1 }
                =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "SetDiscriminant place variant_index", __self_0, &__self_1),
            Self::StorageLive(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "StorageLive", &__self_0),
            Self::StorageDead(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "StorageDead", &__self_0),
            Self::PlaceMention(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "PlaceMention", &__self_0),
            Self::AscribeUserType {
                place: __self_0, projections: __self_1, variance: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "AscribeUserType place projections variance", __self_0,
                    __self_1, &__self_2),
            Self::Coverage(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Coverage", &__self_0),
            Self::Intrinsic(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Intrinsic", &__self_0),
            Self::ConstEvalCounter =>
                ::core::fmt::Formatter::write_str(f, "ConstEvalCounter"),
            Self::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::marker::StructuralPartialEq for
    StatementKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for StatementKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Assign(__self_0, __self_1),
                    Self::Assign(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::FakeRead(__self_0, __self_1),
                    Self::FakeRead(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::SetDiscriminant {
                    place: __self_0, variant_index: __self_1 },
                    Self::SetDiscriminant {
                    place: __arg1_0, variant_index: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::StorageLive(__self_0), Self::StorageLive(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::StorageDead(__self_0), Self::StorageDead(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::PlaceMention(__self_0), Self::PlaceMention(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::AscribeUserType {
                    place: __self_0, projections: __self_1, variance: __self_2
                    }, Self::AscribeUserType {
                    place: __arg1_0, projections: __arg1_1, variance: __arg1_2
                    }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::Coverage(__self_0), Self::Coverage(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Intrinsic(__self_0), Self::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) -> Self {
        match self {
            Self::AddressOf(__self_0, __self_1) =>
                Rvalue::AddressOf(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::Aggregate(__self_0, __self_1) =>
                Rvalue::Aggregate(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::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)),
            Self::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)),
            Self::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)),
            Self::CopyForDeref(__self_0) =>
                Rvalue::CopyForDeref(::core::clone::Clone::clone(__self_0)),
            Self::Discriminant(__self_0) =>
                Rvalue::Discriminant(::core::clone::Clone::clone(__self_0)),
            Self::Len(__self_0) =>
                Rvalue::Len(::core::clone::Clone::clone(__self_0)),
            Self::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)),
            Self::Repeat(__self_0, __self_1) =>
                Rvalue::Repeat(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::ThreadLocalRef(__self_0) =>
                Rvalue::ThreadLocalRef(::core::clone::Clone::clone(__self_0)),
            Self::UnaryOp(__self_0, __self_1) =>
                Rvalue::UnaryOp(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::Use(__self_0, __self_1) =>
                Rvalue::Use(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::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 {
            Self::AddressOf(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "AddressOf", __self_0, &__self_1),
            Self::Aggregate(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Aggregate", __self_0, &__self_1),
            Self::BinaryOp(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "BinaryOp", __self_0, __self_1, &__self_2),
            Self::Cast(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f, "Cast",
                    __self_0, __self_1, &__self_2),
            Self::CheckedBinaryOp(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "CheckedBinaryOp", __self_0, __self_1, &__self_2),
            Self::CopyForDeref(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "CopyForDeref", &__self_0),
            Self::Discriminant(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Discriminant", &__self_0),
            Self::Len(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Len",
                    &__self_0),
            Self::Ref(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f, "Ref",
                    __self_0, __self_1, &__self_2),
            Self::Repeat(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Repeat", __self_0, &__self_1),
            Self::ThreadLocalRef(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ThreadLocalRef", &__self_0),
            Self::UnaryOp(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "UnaryOp", __self_0, &__self_1),
            Self::Use(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f, "Use",
                    __self_0, &__self_1),
            Self::Reborrow(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for Rvalue {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Rvalue {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::AddressOf(__self_0, __self_1),
                    Self::AddressOf(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Aggregate(__self_0, __self_1),
                    Self::Aggregate(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::BinaryOp(__self_0, __self_1, __self_2),
                    Self::BinaryOp(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::Cast(__self_0, __self_1, __self_2),
                    Self::Cast(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::CheckedBinaryOp(__self_0, __self_1, __self_2),
                    Self::CheckedBinaryOp(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::CopyForDeref(__self_0), Self::CopyForDeref(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::Discriminant(__self_0), Self::Discriminant(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::Len(__self_0), Self::Len(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Ref(__self_0, __self_1, __self_2),
                    Self::Ref(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::Repeat(__self_0, __self_1),
                    Self::Repeat(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::ThreadLocalRef(__self_0),
                    Self::ThreadLocalRef(__arg1_0)) => __self_0 == __arg1_0,
                (Self::UnaryOp(__self_0, __self_1),
                    Self::UnaryOp(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Use(__self_0, __self_1), Self::Use(__arg1_0, __arg1_1))
                    => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Reborrow(__self_0, __self_1, __self_2),
                    Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::AddressOf(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::Aggregate(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::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)
            }
            Self::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)
            }
            Self::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)
            }
            Self::CopyForDeref(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Discriminant(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Len(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::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)
            }
            Self::Repeat(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::ThreadLocalRef(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::UnaryOp(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::Use(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::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    Aggregate(AggregateKind, Vec<Operand>),
555
556    /// * `Offset` has the same semantics as `<*const T>::offset`, except that the second
557    ///   parameter may be a `usize` as well.
558    /// * The comparison operations accept `bool`s, `char`s, signed or unsigned integers, floats,
559    ///   raw pointers, or function pointers and return a `bool`. The types of the operands must be
560    ///   matching, up to the usual caveat of the lifetimes in function pointers.
561    /// * Left and right shift operations accept signed or unsigned integers not necessarily of the
562    ///   same type and return a value of the same type as their LHS. Like in Rust, the RHS is
563    ///   truncated as needed.
564    /// * The `Bit*` operations accept signed integers, unsigned integers, or bools with matching
565    ///   types and return a value of that type.
566    /// * The remaining operations accept signed integers, unsigned integers, or floats with
567    ///   matching types and return a value of that type.
568    BinaryOp(BinOp, Operand, Operand),
569
570    /// Performs essentially all of the casts that can be performed via `as`.
571    ///
572    /// This allows for casts from/to a variety of types.
573    Cast(CastKind, Operand, Ty),
574
575    /// Same as `BinaryOp`, but yields `(T, bool)` with a `bool` indicating an error condition.
576    ///
577    /// For addition, subtraction, and multiplication on integers the error condition is set when
578    /// the infinite precision result would not be equal to the actual result.
579    CheckedBinaryOp(BinOp, Operand, Operand),
580
581    /// A CopyForDeref is equivalent to a read from a place.
582    /// When such a read happens, it is guaranteed that the only use of the returned value is a
583    /// deref operation, immediately followed by one or more projections.
584    CopyForDeref(Place),
585
586    /// Computes the discriminant of the place, returning it as an integer.
587    /// Returns zero for types without discriminant.
588    ///
589    /// The validity requirements for the underlying value are undecided for this rvalue, see
590    /// [#91095]. Note too that the value of the discriminant is not the same thing as the
591    /// variant index;
592    ///
593    /// [#91095]: https://github.com/rust-lang/rust/issues/91095
594    Discriminant(Place),
595
596    /// Yields the length of the place, as a `usize`.
597    ///
598    /// If the type of the place is an array, this is the array length. For slices (`[T]`, not
599    /// `&[T]`) this accesses the place's metadata to determine the length. This rvalue is
600    /// ill-formed for places of other types.
601    Len(Place),
602
603    /// Creates a reference to the place.
604    Ref(Region, BorrowKind, Place),
605
606    /// Creates an array where each element is the value of the operand.
607    ///
608    /// This is the cause of a bug in the case where the repetition count is zero because the value
609    /// is not dropped, see [#74836].
610    ///
611    /// Corresponds to source code like `[x; 32]`.
612    ///
613    /// [#74836]: https://github.com/rust-lang/rust/issues/74836
614    Repeat(Operand, TyConst),
615
616    /// Creates a pointer/reference to the given thread local.
617    ///
618    /// The yielded type is a `*mut T` if the static is mutable, otherwise if the static is extern a
619    /// `*const T`, and if neither of those apply a `&T`.
620    ///
621    /// **Note:** This is a runtime operation that actually executes code and is in this sense more
622    /// like a function call. Also, eliminating dead stores of this rvalue causes `fn main() {}` to
623    /// SIGILL for some reason that I (JakobDegen) never got a chance to look into.
624    ///
625    /// **Needs clarification**: Are there weird additional semantics here related to the runtime
626    /// nature of this operation?
627    ThreadLocalRef(crate::CrateItem),
628
629    /// Exactly like `BinaryOp`, but less operands.
630    ///
631    /// Also does two's-complement arithmetic. Negation requires a signed integer or a float;
632    /// bitwise not requires a signed integer, unsigned integer, or bool. Both operation kinds
633    /// return a value with the same type as their operand.
634    UnaryOp(UnOp, Operand),
635
636    /// Yields the operand unchanged, except for possibly a retag.
637    Use(Operand, WithRetag),
638
639    /// Creates a bitwise copy of the source type, producing either a value of the same type (when
640    /// Mutability::Mut) or a different type with a guaranteed equal memory layout defined by the
641    /// CoerceShared trait. See [`Rvalue::Reborrow`] for a more detailed explanation.
642    ///
643    /// [`Rvalue::Reborrow`]: rustc_middle::mir::Rvalue::Reborrow
644    Reborrow(Ty, Mutability, Place),
645}
646
647impl Rvalue {
648    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
649        match self {
650            Rvalue::Use(operand, _) => operand.ty(locals),
651            Rvalue::Repeat(operand, count) => {
652                Ok(Ty::new_array_with_const_len(operand.ty(locals)?, count.clone()))
653            }
654            Rvalue::ThreadLocalRef(did) => Ok(did.ty()),
655            Rvalue::Ref(reg, bk, place) => {
656                let place_ty = place.ty(locals)?;
657                Ok(Ty::new_ref(reg.clone(), place_ty, bk.to_mutable_lossy()))
658            }
659            Rvalue::Reborrow(target, _, _) => Ok(*target),
660            Rvalue::AddressOf(mutability, place) => {
661                let place_ty = place.ty(locals)?;
662                Ok(Ty::new_ptr(place_ty, mutability.to_mutable_lossy()))
663            }
664            Rvalue::Len(..) => Ok(Ty::usize_ty()),
665            Rvalue::Cast(.., ty) => Ok(*ty),
666            Rvalue::BinaryOp(op, lhs, rhs) => {
667                let lhs_ty = lhs.ty(locals)?;
668                let rhs_ty = rhs.ty(locals)?;
669                Ok(op.ty(lhs_ty, rhs_ty))
670            }
671            Rvalue::CheckedBinaryOp(op, lhs, rhs) => {
672                let lhs_ty = lhs.ty(locals)?;
673                let rhs_ty = rhs.ty(locals)?;
674                let ty = op.ty(lhs_ty, rhs_ty);
675                Ok(Ty::new_tuple(&[ty, Ty::bool_ty()]))
676            }
677            Rvalue::UnaryOp(op, operand) => {
678                let arg_ty = operand.ty(locals)?;
679                Ok(op.ty(arg_ty))
680            }
681            Rvalue::Discriminant(place) => {
682                let place_ty = place.ty(locals)?;
683                place_ty
684                    .kind()
685                    .discriminant_ty()
686                    .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:?}"))
687            }
688            Rvalue::Aggregate(ak, ops) => match *ak {
689                AggregateKind::Array(ty) => Ty::try_new_array(ty, ops.len() as u64),
690                AggregateKind::Tuple => Ok(Ty::new_tuple(
691                    &ops.iter().map(|op| op.ty(locals)).collect::<Result<Vec<_>, _>>()?,
692                )),
693                AggregateKind::Adt(def, _, ref args, _, _) => Ok(def.ty_with_args(args)),
694                AggregateKind::Closure(def, ref args) => Ok(Ty::new_closure(def, args.clone())),
695                AggregateKind::Coroutine(def, ref args) => Ok(Ty::new_coroutine(def, args.clone())),
696                AggregateKind::CoroutineClosure(def, ref args) => {
697                    Ok(Ty::new_coroutine_closure(def, args.clone()))
698                }
699                AggregateKind::RawPtr(ty, mutability) => Ok(Ty::new_ptr(ty, mutability)),
700            },
701            Rvalue::CopyForDeref(place) => place.ty(locals),
702        }
703    }
704}
705
706#[derive(#[automatically_derived]impl ::core::clone::Clone for AggregateKind {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Array(__self_0) =>
                AggregateKind::Array(::core::clone::Clone::clone(__self_0)),
            Self::Tuple => AggregateKind::Tuple,
            Self::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)),
            Self::Closure(__self_0, __self_1) =>
                AggregateKind::Closure(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::Coroutine(__self_0, __self_1) =>
                AggregateKind::Coroutine(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::CoroutineClosure(__self_0, __self_1) =>
                AggregateKind::CoroutineClosure(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::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 {
            Self::Array(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Array",
                    &__self_0),
            Self::Tuple => ::core::fmt::Formatter::write_str(f, "Tuple"),
            Self::Adt(__self_0, __self_1, __self_2, __self_3, __self_4) =>
                ::core::fmt::Formatter::debug_struct_field5_finish(f, "Adt",
                    __self_0, __self_1, __self_2, __self_3, &__self_4),
            Self::Closure(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Closure", __self_0, &__self_1),
            Self::Coroutine(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Coroutine", __self_0, &__self_1),
            Self::CoroutineClosure(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "CoroutineClosure", __self_0, &__self_1),
            Self::RawPtr(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    AggregateKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for AggregateKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Array(__self_0), Self::Array(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Adt(__self_0, __self_1, __self_2, __self_3, __self_4),
                    Self::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,
                (Self::Closure(__self_0, __self_1),
                    Self::Closure(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Coroutine(__self_0, __self_1),
                    Self::Coroutine(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::CoroutineClosure(__self_0, __self_1),
                    Self::CoroutineClosure(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::RawPtr(__self_0, __self_1),
                    Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::Array(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::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)
            }
            Self::Closure(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::Coroutine(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::CoroutineClosure(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::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)]
707pub enum AggregateKind {
708    Array(Ty),
709    Tuple,
710    Adt(AdtDef, VariantIdx, GenericArgs, Option<UserTypeAnnotationIndex>, Option<FieldIdx>),
711    Closure(ClosureDef, GenericArgs),
712    Coroutine(CoroutineDef, GenericArgs),
713    CoroutineClosure(CoroutineClosureDef, GenericArgs),
714    RawPtr(Ty, Mutability),
715}
716
717#[derive(#[automatically_derived]impl ::core::clone::Clone for Operand {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Copy(__self_0) =>
                Operand::Copy(::core::clone::Clone::clone(__self_0)),
            Self::Move(__self_0) =>
                Operand::Move(::core::clone::Clone::clone(__self_0)),
            Self::Constant(__self_0) =>
                Operand::Constant(::core::clone::Clone::clone(__self_0)),
            Self::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 {
            Self::Copy(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Copy",
                    &__self_0),
            Self::Move(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Move",
                    &__self_0),
            Self::Constant(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Constant", &__self_0),
            Self::RuntimeChecks(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for Operand {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Operand {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Copy(__self_0), Self::Copy(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Move(__self_0), Self::Move(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Constant(__self_0), Self::Constant(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::RuntimeChecks(__self_0), Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::Copy(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Move(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Constant(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::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)]
718pub enum Operand {
719    Copy(Place),
720    Move(Place),
721    Constant(ConstOperand),
722    RuntimeChecks(RuntimeChecks),
723}
724
725#[derive(#[automatically_derived]impl ::core::clone::Clone for Place {
    #[inline]
    fn clone(&self) -> Self {
        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::marker::StructuralPartialEq for Place { }
#[automatically_derived]impl ::core::cmp::PartialEq for Place {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
726pub struct Place {
727    pub local: Local,
728    /// projection out of a place (access a field, deref a pointer, etc)
729    pub projection: Vec<ProjectionElem>,
730}
731
732impl From<Local> for Place {
733    fn from(local: Local) -> Self {
734        Place { local, projection: ::alloc::vec::Vec::new()vec![] }
735    }
736}
737
738#[derive(#[automatically_derived]impl ::core::clone::Clone for ConstOperand {
    #[inline]
    fn clone(&self) -> Self {
        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 user_ty const_", &self.span, &self.user_ty,
            &&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::marker::StructuralPartialEq for
    ConstOperand {
}
#[automatically_derived]impl ::core::cmp::PartialEq for ConstOperand {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
739pub struct ConstOperand {
740    pub span: Span,
741    pub user_ty: Option<UserTypeAnnotationIndex>,
742    pub const_: MirConst,
743}
744
745#[derive(#[automatically_derived]impl ::core::clone::Clone for RuntimeChecks {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::UbChecks => RuntimeChecks::UbChecks,
            Self::ContractChecks => RuntimeChecks::ContractChecks,
            Self::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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    RuntimeChecks {
}
#[automatically_derived]impl ::core::cmp::PartialEq for RuntimeChecks {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for RuntimeChecks {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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)]
746pub enum RuntimeChecks {
747    /// cfg!(ub_checks), but at codegen time
748    UbChecks,
749    /// cfg!(contract_checks), but at codegen time
750    ContractChecks,
751    /// cfg!(overflow_checks), but at codegen time
752    OverflowChecks,
753}
754
755/// Debug information pertaining to a user variable.
756#[derive(#[automatically_derived]impl ::core::clone::Clone for VarDebugInfo {
    #[inline]
    fn clone(&self) -> Self {
        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 source_info composite value argument_index",
            &self.name, &self.source_info, &self.composite, &self.value,
            &&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::marker::StructuralPartialEq for
    VarDebugInfo {
}
#[automatically_derived]impl ::core::cmp::PartialEq for VarDebugInfo {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
757pub struct VarDebugInfo {
758    /// The variable name.
759    pub name: Symbol,
760
761    /// Source info of the user variable, including the scope
762    /// within which the variable is visible (to debuginfo).
763    pub source_info: SourceInfo,
764
765    /// The user variable's data is split across several fragments,
766    /// each described by a `VarDebugInfoFragment`.
767    pub composite: Option<VarDebugInfoFragment>,
768
769    /// Where the data for this user variable is to be found.
770    pub value: VarDebugInfoContents,
771
772    /// When present, indicates what argument number this variable is in the function that it
773    /// originated from (starting from 1). Note, if MIR inlining is enabled, then this is the
774    /// argument number in the original function before it was inlined.
775    pub argument_index: Option<u16>,
776}
777
778impl VarDebugInfo {
779    /// Return a local variable if this info is related to one.
780    pub fn local(&self) -> Option<Local> {
781        match &self.value {
782            VarDebugInfoContents::Place(place) if place.projection.is_empty() => Some(place.local),
783            VarDebugInfoContents::Place(_) | VarDebugInfoContents::Const(_) => None,
784        }
785    }
786
787    /// Return a constant if this info is related to one.
788    pub fn constant(&self) -> Option<&ConstOperand> {
789        match &self.value {
790            VarDebugInfoContents::Place(_) => None,
791            VarDebugInfoContents::Const(const_op) => Some(const_op),
792        }
793    }
794}
795
796pub type SourceScope = u32;
797
798/// Data about a source scope, used for caller location resolution.
799///
800/// Each entry corresponds to a source scope in the MIR body. Most scopes have no
801/// inlined data. For scopes introduced by MIR inlining, `inlined` records whether
802/// the inlined callee is `#[track_caller]` and the span of the call site.
803#[derive(#[automatically_derived]impl ::core::clone::Clone for SourceScopeInfo {
    #[inline]
    fn clone(&self) -> Self {
        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 inlined_parent_scope", &self.inlined,
            &&self.inlined_parent_scope)
    }
}Debug, #[automatically_derived]impl ::core::default::Default for SourceScopeInfo {
    #[inline]
    fn default() -> Self {
        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::marker::StructuralPartialEq for
    SourceScopeInfo {
}
#[automatically_derived]impl ::core::cmp::PartialEq for SourceScopeInfo {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
804pub(crate) struct SourceScopeInfo {
805    /// Present when this scope was introduced by inlining a function.
806    /// The `bool` is `true` if the inlined callee is `#[track_caller]`.
807    /// The `Span` is the call site where inlining occurred.
808    pub inlined: Option<(bool, Span)>,
809    /// Nearest (transitive) parent scope that was itself inlined.
810    /// Skips over intermediate scopes within the same inlined function body.
811    pub inlined_parent_scope: Option<SourceScope>,
812}
813
814#[derive(#[automatically_derived]impl ::core::clone::Clone for SourceInfo {
    #[inline]
    fn clone(&self) -> Self {
        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 scope", &self.span, &&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::marker::StructuralPartialEq for
    SourceInfo {
}
#[automatically_derived]impl ::core::cmp::PartialEq for SourceInfo {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
815pub struct SourceInfo {
816    pub span: Span,
817    pub scope: SourceScope,
818}
819
820#[derive(#[automatically_derived]impl ::core::clone::Clone for VarDebugInfoFragment {
    #[inline]
    fn clone(&self) -> Self {
        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 projection", &self.ty, &&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::marker::StructuralPartialEq for
    VarDebugInfoFragment {
}
#[automatically_derived]impl ::core::cmp::PartialEq for VarDebugInfoFragment {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
821pub struct VarDebugInfoFragment {
822    pub ty: Ty,
823    pub projection: Vec<ProjectionElem>,
824}
825
826#[derive(#[automatically_derived]impl ::core::clone::Clone for VarDebugInfoContents {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Place(__self_0) =>
                VarDebugInfoContents::Place(::core::clone::Clone::clone(__self_0)),
            Self::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 {
            Self::Place(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Place",
                    &__self_0),
            Self::Const(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    VarDebugInfoContents {
}
#[automatically_derived]impl ::core::cmp::PartialEq for VarDebugInfoContents {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Place(__self_0), Self::Place(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Const(__self_0), Self::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)]
827pub enum VarDebugInfoContents {
828    Place(Place),
829    Const(ConstOperand),
830}
831
832// In MIR ProjectionElem is parameterized on the second Field argument and the Index argument. This
833// is so it can be used for both Places (for which the projection elements are of type
834// ProjectionElem<Local, Ty>) and user-provided type annotations (for which the projection elements
835// are of type ProjectionElem<(), ()>).
836// In rustc_public's IR we don't need this generality, so we just use ProjectionElem for Places.
837#[derive(#[automatically_derived]impl ::core::clone::Clone for ProjectionElem {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Deref => ProjectionElem::Deref,
            Self::Field(__self_0, __self_1) =>
                ProjectionElem::Field(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::Index(__self_0) =>
                ProjectionElem::Index(::core::clone::Clone::clone(__self_0)),
            Self::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),
                },
            Self::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),
                },
            Self::Downcast(__self_0) =>
                ProjectionElem::Downcast(::core::clone::Clone::clone(__self_0)),
            Self::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 {
            Self::Deref => ::core::fmt::Formatter::write_str(f, "Deref"),
            Self::Field(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f, "Field",
                    __self_0, &__self_1),
            Self::Index(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Index",
                    &__self_0),
            Self::ConstantIndex {
                offset: __self_0, min_length: __self_1, from_end: __self_2 }
                =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "ConstantIndex offset min_length from_end", __self_0,
                    __self_1, &__self_2),
            Self::Subslice { from: __self_0, to: __self_1, from_end: __self_2
                } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Subslice from to from_end", __self_0, __self_1, &__self_2),
            Self::Downcast(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Downcast", &__self_0),
            Self::OpaqueCast(__self_0) =>
                ::core::fmt::Formatter::debug_struct_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::marker::StructuralPartialEq for
    ProjectionElem {
}
#[automatically_derived]impl ::core::cmp::PartialEq for ProjectionElem {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Field(__self_0, __self_1),
                    Self::Field(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Index(__self_0), Self::Index(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::ConstantIndex {
                    offset: __self_0, min_length: __self_1, from_end: __self_2
                    }, Self::ConstantIndex {
                    offset: __arg1_0, min_length: __arg1_1, from_end: __arg1_2
                    }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::Subslice {
                    from: __self_0, to: __self_1, from_end: __self_2 },
                    Self::Subslice {
                    from: __arg1_0, to: __arg1_1, from_end: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::Downcast(__self_0), Self::Downcast(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::OpaqueCast(__self_0), Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::Field(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::Index(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::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)
            }
            Self::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)
            }
            Self::Downcast(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::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)]
838pub enum ProjectionElem {
839    /// Dereference projections (e.g. `*_1`) project to the address referenced by the base place.
840    Deref,
841
842    /// A field projection (e.g., `f` in `_1.f`) project to a field in the base place. The field is
843    /// referenced by source-order index rather than the name of the field. The fields type is also
844    /// given.
845    Field(FieldIdx, Ty),
846
847    /// Index into a slice/array. The value of the index is computed at runtime using the `V`
848    /// argument.
849    ///
850    /// Note that this does not also dereference, and so it does not exactly correspond to slice
851    /// indexing in Rust. In other words, in the below Rust code:
852    ///
853    /// ```rust
854    /// let x = &[1, 2, 3, 4];
855    /// let i = 2;
856    /// x[i];
857    /// ```
858    ///
859    /// The `x[i]` is turned into a `Deref` followed by an `Index`, not just an `Index`. The same
860    /// thing is true of the `ConstantIndex` and `Subslice` projections below.
861    Index(Local),
862
863    /// Index into a slice/array given by offsets.
864    ///
865    /// These indices are generated by slice patterns. Easiest to explain by example:
866    ///
867    /// ```ignore (illustrative)
868    /// [X, _, .._, _, _] => { offset: 0, min_length: 4, from_end: false },
869    /// [_, X, .._, _, _] => { offset: 1, min_length: 4, from_end: false },
870    /// [_, _, .._, X, _] => { offset: 2, min_length: 4, from_end: true },
871    /// [_, _, .._, _, X] => { offset: 1, min_length: 4, from_end: true },
872    /// ```
873    ConstantIndex {
874        /// index or -index (in Python terms), depending on from_end
875        offset: u64,
876        /// The thing being indexed must be at least this long -- otherwise, the
877        /// projection is UB.
878        ///
879        /// For arrays this is always the exact length.
880        min_length: u64,
881        /// Counting backwards from end? This is always false when indexing an
882        /// array.
883        from_end: bool,
884    },
885
886    /// Projects a slice from the base place.
887    ///
888    /// These indices are generated by slice patterns. If `from_end` is true, this represents
889    /// `slice[from..slice.len() - to]`. Otherwise it represents `array[from..to]`.
890    Subslice {
891        from: u64,
892        to: u64,
893        /// Whether `to` counts from the start or end of the array/slice.
894        from_end: bool,
895    },
896
897    /// "Downcast" to a variant of an enum or a coroutine.
898    Downcast(VariantIdx),
899
900    /// Like an explicit cast from an opaque type to a concrete type, but without
901    /// requiring an intermediate variable.
902    OpaqueCast(Ty),
903}
904
905#[derive(#[automatically_derived]impl ::core::clone::Clone for UserTypeProjection {
    #[inline]
    fn clone(&self) -> Self {
        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 projection", &self.base,
            &&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::marker::StructuralPartialEq for
    UserTypeProjection {
}
#[automatically_derived]impl ::core::cmp::PartialEq for UserTypeProjection {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
906pub struct UserTypeProjection {
907    pub base: UserTypeAnnotationIndex,
908
909    pub projection: Opaque,
910}
911
912pub type Local = usize;
913
914pub const RETURN_LOCAL: Local = 0;
915
916/// The source-order index of a field in a variant.
917///
918/// For example, in the following types,
919/// ```ignore(illustrative)
920/// enum Demo1 {
921///    Variant0 { a: bool, b: i32 },
922///    Variant1 { c: u8, d: u64 },
923/// }
924/// struct Demo2 { e: u8, f: u16, g: u8 }
925/// ```
926/// `a`'s `FieldIdx` is `0`,
927/// `b`'s `FieldIdx` is `1`,
928/// `c`'s `FieldIdx` is `0`, and
929/// `g`'s `FieldIdx` is `2`.
930pub type FieldIdx = usize;
931
932type UserTypeAnnotationIndex = usize;
933
934/// The possible branch sites of a [TerminatorKind::SwitchInt].
935#[derive(#[automatically_derived]impl ::core::clone::Clone for SwitchTargets {
    #[inline]
    fn clone(&self) -> Self {
        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 otherwise", &self.branches,
            &&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::marker::StructuralPartialEq for
    SwitchTargets {
}
#[automatically_derived]impl ::core::cmp::PartialEq for SwitchTargets {
    #[inline]
    fn eq(&self, other: &Self) -> 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)]
936pub struct SwitchTargets {
937    /// The conditional branches where the first element represents the value that guards this
938    /// branch, and the second element is the branch target.
939    branches: Vec<(u128, BasicBlockIdx)>,
940    /// The `otherwise` branch which will be taken in case none of the conditional branches are
941    /// satisfied.
942    otherwise: BasicBlockIdx,
943}
944
945impl SwitchTargets {
946    /// All possible targets including the `otherwise` target.
947    pub fn all_targets(&self) -> Successors {
948        self.branches.iter().map(|(_, target)| *target).chain(Some(self.otherwise)).collect()
949    }
950
951    /// The `otherwise` branch target.
952    pub fn otherwise(&self) -> BasicBlockIdx {
953        self.otherwise
954    }
955
956    /// The conditional targets which are only taken if the pattern matches the given value.
957    pub fn branches(&self) -> impl Iterator<Item = (u128, BasicBlockIdx)> {
958        self.branches.iter().copied()
959    }
960
961    /// The number of targets including `otherwise`.
962    pub fn len(&self) -> usize {
963        self.branches.len() + 1
964    }
965
966    /// Create a new SwitchTargets from the given branches and `otherwise` target.
967    pub fn new(branches: Vec<(u128, BasicBlockIdx)>, otherwise: BasicBlockIdx) -> SwitchTargets {
968        SwitchTargets { branches, otherwise }
969    }
970}
971
972#[derive(#[automatically_derived]impl ::core::marker::Copy for BorrowKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for BorrowKind {
}
#[automatically_derived]impl ::core::clone::Clone for BorrowKind {
    #[inline]
    fn clone(&self) -> Self {
        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 {
            Self::Shared => ::core::fmt::Formatter::write_str(f, "Shared"),
            Self::Fake(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Fake",
                    &__self_0),
            Self::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::marker::StructuralPartialEq for
    BorrowKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for BorrowKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Fake(__self_0), Self::Fake(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Mut { kind: __self_0 }, Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::Fake(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::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)]
973pub enum BorrowKind {
974    /// Data must be immutable and is aliasable.
975    Shared,
976
977    /// An immutable, aliasable borrow that is discarded after borrow-checking. Can behave either
978    /// like a normal shared borrow or like a special shallow borrow (see [`FakeBorrowKind`]).
979    Fake(FakeBorrowKind),
980
981    /// Data is mutable and not aliasable.
982    Mut {
983        /// `true` if this borrow arose from method-call auto-ref
984        kind: MutBorrowKind,
985    },
986}
987
988impl BorrowKind {
989    pub fn to_mutable_lossy(self) -> Mutability {
990        match self {
991            BorrowKind::Mut { .. } => Mutability::Mut,
992            BorrowKind::Shared => Mutability::Not,
993            // FIXME: There's no type corresponding to a shallow borrow, so use `&` as an approximation.
994            BorrowKind::Fake(_) => Mutability::Not,
995        }
996    }
997}
998
999#[derive(#[automatically_derived]impl ::core::marker::Copy for RawPtrKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for RawPtrKind {
}
#[automatically_derived]impl ::core::clone::Clone for RawPtrKind {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    RawPtrKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for RawPtrKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for RawPtrKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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)]
1000pub enum RawPtrKind {
1001    Mut,
1002    Const,
1003    FakeForPtrMetadata,
1004}
1005
1006impl RawPtrKind {
1007    pub fn to_mutable_lossy(self) -> Mutability {
1008        match self {
1009            RawPtrKind::Mut { .. } => Mutability::Mut,
1010            RawPtrKind::Const => Mutability::Not,
1011            // FIXME: There's no type corresponding to a shallow borrow, so use `&` as an approximation.
1012            RawPtrKind::FakeForPtrMetadata => Mutability::Not,
1013        }
1014    }
1015}
1016
1017#[derive(#[automatically_derived]impl ::core::marker::Copy for MutBorrowKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for MutBorrowKind {
}
#[automatically_derived]impl ::core::clone::Clone for MutBorrowKind {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    MutBorrowKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for MutBorrowKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for MutBorrowKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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)]
1018pub enum MutBorrowKind {
1019    Default,
1020    TwoPhaseBorrow,
1021    ClosureCapture,
1022}
1023
1024#[derive(#[automatically_derived]impl ::core::marker::Copy for FakeBorrowKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for FakeBorrowKind {
}
#[automatically_derived]impl ::core::clone::Clone for FakeBorrowKind {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    FakeBorrowKind {
}
#[automatically_derived]impl ::core::cmp::PartialEq for FakeBorrowKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for FakeBorrowKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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)]
1025pub enum FakeBorrowKind {
1026    /// A shared (deep) borrow. Data must be immutable and is aliasable.
1027    Deep,
1028    /// The immediately borrowed place must be immutable, but projections from
1029    /// it don't need to be. This is used to prevent match guards from replacing
1030    /// the scrutinee. For example, a fake borrow of `a.b` doesn't
1031    /// conflict with a mutable borrow of `a.b.c`.
1032    Shallow,
1033}
1034
1035#[derive(#[automatically_derived]impl ::core::marker::Copy for Mutability { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Mutability {
}
#[automatically_derived]impl ::core::clone::Clone for Mutability {
    #[inline]
    fn clone(&self) -> Self { *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::marker::StructuralPartialEq for
    Mutability {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Mutability {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for Mutability { }Eq, #[automatically_derived]impl ::core::hash::Hash for Mutability {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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)]
1036pub enum Mutability {
1037    Not,
1038    Mut,
1039}
1040
1041#[derive(#[automatically_derived]impl ::core::marker::Copy for Safety { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for Safety {
}
#[automatically_derived]impl ::core::clone::Clone for Safety {
    #[inline]
    fn clone(&self) -> Self { *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 { }Eq, #[automatically_derived]impl ::core::marker::StructuralPartialEq for Safety {
}
#[automatically_derived]impl ::core::cmp::PartialEq for Safety {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
            ::core::intrinsics::discriminant_value(other)
    }
}PartialEq, #[automatically_derived]impl ::core::hash::Hash for Safety {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            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)]
1042pub enum Safety {
1043    Safe,
1044    Unsafe,
1045}
1046
1047#[derive(#[automatically_derived]impl ::core::marker::Copy for PointerCoercion { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for PointerCoercion {
}
#[automatically_derived]impl ::core::clone::Clone for PointerCoercion {
    #[inline]
    fn clone(&self) -> Self {
        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 {
            Self::ReifyFnPointer(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ReifyFnPointer", &__self_0),
            Self::UnsafeFnPointer =>
                ::core::fmt::Formatter::write_str(f, "UnsafeFnPointer"),
            Self::ClosureFnPointer(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ClosureFnPointer", &__self_0),
            Self::MutToConstPointer =>
                ::core::fmt::Formatter::write_str(f, "MutToConstPointer"),
            Self::ArrayToPointer =>
                ::core::fmt::Formatter::write_str(f, "ArrayToPointer"),
            Self::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::marker::StructuralPartialEq for
    PointerCoercion {
}
#[automatically_derived]impl ::core::cmp::PartialEq for PointerCoercion {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::ReifyFnPointer(__self_0),
                    Self::ReifyFnPointer(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ClosureFnPointer(__self_0),
                    Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::ReifyFnPointer(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::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)]
1048pub enum PointerCoercion {
1049    /// Go from a fn-item type to a fn-pointer type.
1050    ReifyFnPointer(Safety),
1051
1052    /// Go from a safe fn pointer to an unsafe fn pointer.
1053    UnsafeFnPointer,
1054
1055    /// Go from a non-capturing closure to a fn pointer or an unsafe fn pointer.
1056    /// It cannot convert a closure that requires unsafe.
1057    ClosureFnPointer(Safety),
1058
1059    /// Go from a mut raw pointer to a const raw pointer.
1060    MutToConstPointer,
1061
1062    /// Go from `*const [T; N]` to `*const T`
1063    ArrayToPointer,
1064
1065    /// Unsize a pointer/reference value, e.g., `&[T; n]` to
1066    /// `&[T]`. Note that the source could be a thin or wide pointer.
1067    /// This will do things like convert thin pointers to wide
1068    /// pointers, or convert structs containing thin pointers to
1069    /// structs containing wide pointers, or convert between wide
1070    /// pointers.
1071    Unsize,
1072}
1073
1074#[derive(#[automatically_derived]impl ::core::marker::Copy for CastKind { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CastKind {
}
#[automatically_derived]impl ::core::clone::Clone for CastKind {
    #[inline]
    fn clone(&self) -> Self {
        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 {
            Self::PointerExposeAddress =>
                ::core::fmt::Formatter::write_str(f, "PointerExposeAddress"),
            Self::PointerWithExposedProvenance =>
                ::core::fmt::Formatter::write_str(f,
                    "PointerWithExposedProvenance"),
            Self::PointerCoercion(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "PointerCoercion", &__self_0),
            Self::IntToInt =>
                ::core::fmt::Formatter::write_str(f, "IntToInt"),
            Self::FloatToInt =>
                ::core::fmt::Formatter::write_str(f, "FloatToInt"),
            Self::FloatToFloat =>
                ::core::fmt::Formatter::write_str(f, "FloatToFloat"),
            Self::IntToFloat =>
                ::core::fmt::Formatter::write_str(f, "IntToFloat"),
            Self::PtrToPtr =>
                ::core::fmt::Formatter::write_str(f, "PtrToPtr"),
            Self::FnPtrToPtr =>
                ::core::fmt::Formatter::write_str(f, "FnPtrToPtr"),
            Self::Transmute =>
                ::core::fmt::Formatter::write_str(f, "Transmute"),
            Self::BoxDerefTransmute =>
                ::core::fmt::Formatter::write_str(f, "BoxDerefTransmute"),
            Self::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::marker::StructuralPartialEq for CastKind
    {
}
#[automatically_derived]impl ::core::cmp::PartialEq for CastKind {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::PointerCoercion(__self_0),
                    Self::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) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::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)]
1075pub enum CastKind {
1076    // FIXME(smir-rename): rename this to PointerExposeProvenance
1077    PointerExposeAddress,
1078    PointerWithExposedProvenance,
1079    PointerCoercion(PointerCoercion),
1080    IntToInt,
1081    FloatToInt,
1082    FloatToFloat,
1083    IntToFloat,
1084    PtrToPtr,
1085    FnPtrToPtr,
1086    Transmute,
1087    BoxDerefTransmute,
1088    Subtype,
1089}
1090
1091impl Operand {
1092    /// Get the type of an operand relative to the local declaration.
1093    ///
1094    /// In order to retrieve the correct type, the `locals` argument must match the list of all
1095    /// locals from the function body where this operand originates from.
1096    ///
1097    /// Errors indicate a malformed operand or incompatible locals list.
1098    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
1099        match self {
1100            Operand::Copy(place) | Operand::Move(place) => place.ty(locals),
1101            Operand::Constant(c) => Ok(c.ty()),
1102            Operand::RuntimeChecks(_) => Ok(Ty::bool_ty()),
1103        }
1104    }
1105}
1106
1107impl ConstOperand {
1108    pub fn ty(&self) -> Ty {
1109        self.const_.ty()
1110    }
1111}
1112
1113impl Place {
1114    /// Resolve down the chain of projections to get the type referenced at the end of it.
1115    /// E.g.:
1116    /// Calling `ty()` on `var.field` should return the type of `field`.
1117    ///
1118    /// In order to retrieve the correct type, the `locals` argument must match the list of all
1119    /// locals from the function body where this place originates from.
1120    pub fn ty(&self, locals: &[LocalDecl]) -> Result<Ty, Error> {
1121        self.projection.iter().try_fold(locals[self.local].ty, |place_ty, elem| elem.ty(place_ty))
1122    }
1123}
1124
1125impl ProjectionElem {
1126    /// Get the expected type after applying this projection to a given place type.
1127    pub fn ty(&self, place_ty: Ty) -> Result<Ty, Error> {
1128        let ty = place_ty;
1129        match &self {
1130            ProjectionElem::Deref => Self::deref_ty(ty),
1131            ProjectionElem::Field(_idx, fty) => Ok(*fty),
1132            ProjectionElem::Index(_) | ProjectionElem::ConstantIndex { .. } => Self::index_ty(ty),
1133            ProjectionElem::Subslice { from, to, from_end } => {
1134                Self::subslice_ty(ty, *from, *to, *from_end)
1135            }
1136            ProjectionElem::Downcast(_) => Ok(ty),
1137            ProjectionElem::OpaqueCast(ty) => Ok(*ty),
1138        }
1139    }
1140
1141    fn index_ty(ty: Ty) -> Result<Ty, Error> {
1142        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:?}"))
1143    }
1144
1145    fn subslice_ty(ty: Ty, from: u64, to: u64, from_end: bool) -> Result<Ty, Error> {
1146        let ty_kind = ty.kind();
1147        match ty_kind {
1148            TyKind::RigidTy(RigidTy::Slice(..)) => Ok(ty),
1149            TyKind::RigidTy(RigidTy::Array(inner, _)) if !from_end => Ty::try_new_array(
1150                inner,
1151                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}"))?,
1152            ),
1153            TyKind::RigidTy(RigidTy::Array(inner, size)) => {
1154                let size = size.eval_target_usize()?;
1155                let len = size - from - to;
1156                Ty::try_new_array(inner, len)
1157            }
1158            _ => 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:?}`"))),
1159        }
1160    }
1161
1162    fn deref_ty(ty: Ty) -> Result<Ty, Error> {
1163        let deref_ty = ty
1164            .kind()
1165            .builtin_deref(true)
1166            .ok_or_else(|| Error(::alloc::__export::must_use({
            ::alloc::fmt::format(format_args!("Cannot dereference type: {0:?}",
                    ty))
        }))error!("Cannot dereference type: {ty:?}"))?;
1167        Ok(deref_ty.ty)
1168    }
1169}
1170
1171/// Return the maximum scope index referenced by any terminator or statement in `blocks`.
1172fn max_scope(blocks: &[BasicBlock]) -> u32 {
1173    blocks
1174        .iter()
1175        .flat_map(|bb| {
1176            std::iter::once(bb.terminator.source_info.scope)
1177                .chain(bb.statements.iter().map(|s| s.source_info.scope))
1178        })
1179        .max()
1180        .unwrap_or(0)
1181}