Skip to main content

rustc_middle/traits/
mod.rs

1//! Trait Resolution. See the [rustc dev guide] for more information on how this works.
2//!
3//! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/traits/resolution.html
4
5pub mod cache;
6pub mod query;
7pub mod select;
8pub mod solve;
9pub mod specialization_graph;
10mod structural_impls;
11
12use std::borrow::Cow;
13use std::hash::{Hash, Hasher};
14use std::sync::Arc;
15
16use rustc_errors::{Applicability, Diag, ErrorGuaranteed};
17use rustc_hir as hir;
18use rustc_hir::HirId;
19use rustc_hir::def_id::DefId;
20use rustc_macros::{
21    Decodable, Encodable, StableHash, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
22};
23use rustc_span::def_id::{CRATE_DEF_ID, LocalDefId};
24use rustc_span::{DUMMY_SP, OrdSpan, Span, Symbol, sym};
25use smallvec::{SmallVec, smallvec};
26use thin_vec::ThinVec;
27
28pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, SelectionCache};
29use crate::mir::ConstraintCategory;
30pub use crate::traits::solve::BuiltinImplSource;
31use crate::ty::abstract_const::NotConstEvaluatable;
32use crate::ty::{self, AdtKind, GenericArgs, Ty};
33
34/// The reason why we incurred this obligation; used for error reporting.
35///
36/// Non-misc `ObligationCauseCode`s are stored on the heap. This gives the
37/// best trade-off between keeping the type small (which makes copies cheaper)
38/// while not doing too many heap allocations.
39///
40/// We do not want to intern this as there are a lot of obligation causes which
41/// only live for a short period of time.
42#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    ObligationCause<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        ObligationCause {
            span: ::core::clone::Clone::clone(&self.span),
            body_def_id: ::core::clone::Clone::clone(&self.body_def_id),
            code: ::core::clone::Clone::clone(&self.code),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    ObligationCause<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "ObligationCause span body_def_id code", &self.span,
            &self.body_def_id, &&self.code)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    ObligationCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    ObligationCause<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.span == other.span && self.body_def_id == other.body_def_id &&
            self.code == other.code
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for ObligationCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ObligationCause<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ObligationCause {
                        span: ref __binding_0,
                        body_def_id: ref __binding_1,
                        code: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ObligationCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let ObligationCause {
                        span: ref __binding_0,
                        body_def_id: ref __binding_1,
                        code: ref __binding_2 } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for ObligationCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                ObligationCause {
                    span: ::rustc_serialize::Decodable::decode(__decoder),
                    body_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                    code: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
43#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ObligationCause<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ObligationCause {
                        span: ref __binding_0,
                        body_def_id: ref __binding_1,
                        code: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ObligationCause<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ObligationCause {
                            span: __binding_0,
                            body_def_id: __binding_1,
                            code: __binding_2 } => {
                            ObligationCause {
                                span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                body_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ObligationCause {
                        span: __binding_0,
                        body_def_id: __binding_1,
                        code: __binding_2 } => {
                        ObligationCause {
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            body_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
44pub struct ObligationCause<'tcx> {
45    pub span: Span,
46
47    /// The ID of the fn that triggered this obligation. This is
48    /// used for region obligations to determine the precise
49    /// environment in which the region obligation should be evaluated
50    /// (in particular, closures can add new assumptions). See the
51    /// field `region_obligations` of the `FulfillmentContext` for more
52    /// information.
53    pub body_def_id: LocalDefId,
54
55    code: ObligationCauseCodeHandle<'tcx>,
56}
57
58// This custom hash function speeds up hashing for `Obligation` deduplication
59// greatly by skipping the `code` field, which can be large and complex. That
60// shouldn't affect hash quality much since there are several other fields in
61// `Obligation` which should be unique enough, especially the predicate itself
62// which is hashed as an interned pointer. See #90996.
63impl Hash for ObligationCause<'_> {
64    fn hash<H: Hasher>(&self, state: &mut H) {
65        self.body_def_id.hash(state);
66        self.span.hash(state);
67    }
68}
69
70impl<'tcx> ObligationCause<'tcx> {
71    #[inline]
72    pub fn new(
73        span: Span,
74        body_def_id: LocalDefId,
75        code: ObligationCauseCode<'tcx>,
76    ) -> ObligationCause<'tcx> {
77        ObligationCause { span, body_def_id, code: code.into() }
78    }
79
80    pub fn misc(span: Span, body_def_id: LocalDefId) -> ObligationCause<'tcx> {
81        ObligationCause::new(span, body_def_id, ObligationCauseCode::Misc)
82    }
83
84    #[inline(always)]
85    pub fn dummy() -> ObligationCause<'tcx> {
86        ObligationCause::dummy_with_span(DUMMY_SP)
87    }
88
89    #[inline(always)]
90    pub fn dummy_with_span(span: Span) -> ObligationCause<'tcx> {
91        ObligationCause { span, body_def_id: CRATE_DEF_ID, code: Default::default() }
92    }
93
94    #[inline]
95    pub fn code(&self) -> &ObligationCauseCode<'tcx> {
96        &self.code
97    }
98
99    pub fn map_code(
100        &mut self,
101        f: impl FnOnce(ObligationCauseCodeHandle<'tcx>) -> ObligationCauseCode<'tcx>,
102    ) {
103        self.code = f(std::mem::take(&mut self.code)).into();
104    }
105
106    pub fn derived_cause(
107        mut self,
108        parent_trait_pred: ty::PolyTraitClause<'tcx>,
109        variant: impl FnOnce(DerivedCause<'tcx>) -> ObligationCauseCode<'tcx>,
110    ) -> ObligationCause<'tcx> {
111        /*!
112         * Creates a cause for obligations that are derived from
113         * `obligation` by a recursive search (e.g., for a builtin
114         * bound, or eventually a `auto trait Foo`). If `obligation`
115         * is itself a derived obligation, this is just a clone, but
116         * otherwise we create a "derived obligation" cause so as to
117         * keep track of the original root obligation for error
118         * reporting.
119         */
120
121        // NOTE(flaper87): As of now, it keeps track of the whole error
122        // chain. Ideally, we should have a way to configure this either
123        // by using -Z verbose-internals or just a CLI argument.
124        self.code = variant(DerivedCause { parent_trait_pred, parent_code: self.code }).into();
125        self
126    }
127
128    pub fn derived_host_cause(
129        mut self,
130        parent_host_clause: ty::Binder<'tcx, ty::HostEffectClause<'tcx>>,
131        variant: impl FnOnce(DerivedHostCause<'tcx>) -> ObligationCauseCode<'tcx>,
132    ) -> ObligationCause<'tcx> {
133        self.code = variant(DerivedHostCause { parent_host_clause, parent_code: self.code }).into();
134        self
135    }
136
137    pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {
138        match self.code() {
139            ObligationCauseCode::MatchImpl(cause, _) => cause.to_constraint_category(),
140            ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span, def_id) => {
141                ConstraintCategory::Predicate(*predicate_span, *def_id)
142            }
143            _ => ConstraintCategory::BoringNoLocation,
144        }
145    }
146}
147
148/// A compact form of `ObligationCauseCode`.
149#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    ObligationCauseCodeHandle<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        ObligationCauseCodeHandle {
            code: ::core::clone::Clone::clone(&self.code),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    ObligationCauseCodeHandle<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    ObligationCauseCodeHandle<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool { self.code == other.code }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
    ObligationCauseCodeHandle<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<Option<Arc<ObligationCauseCode<'tcx>>>>;
    }
}Eq, #[automatically_derived]impl<'tcx> ::core::default::Default for
    ObligationCauseCodeHandle<'tcx> {
    #[inline]
    fn default() -> Self {
        ObligationCauseCodeHandle {
            code: ::core::default::Default::default(),
        }
    }
}Default, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ObligationCauseCodeHandle<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ObligationCauseCodeHandle { code: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
150#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ObligationCauseCodeHandle<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ObligationCauseCodeHandle { code: ref __binding_0 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ObligationCauseCodeHandle<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ObligationCauseCodeHandle { code: __binding_0 } => {
                            ObligationCauseCodeHandle {
                                code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ObligationCauseCodeHandle { code: __binding_0 } => {
                        ObligationCauseCodeHandle {
                            code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for
            ObligationCauseCodeHandle<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let ObligationCauseCodeHandle { code: ref __binding_0 } =
                    *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for
            ObligationCauseCodeHandle<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                ObligationCauseCodeHandle {
                    code: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
151pub struct ObligationCauseCodeHandle<'tcx> {
152    /// `None` for `ObligationCauseCode::Misc` (a common case, occurs ~60% of
153    /// the time). `Some` otherwise.
154    code: Option<Arc<ObligationCauseCode<'tcx>>>,
155}
156
157impl<'tcx> std::fmt::Debug for ObligationCauseCodeHandle<'tcx> {
158    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
159        let cause: &ObligationCauseCode<'_> = self;
160        cause.fmt(f)
161    }
162}
163
164impl<'tcx> ObligationCauseCode<'tcx> {
165    #[inline(always)]
166    fn into(self) -> ObligationCauseCodeHandle<'tcx> {
167        ObligationCauseCodeHandle {
168            code: if let ObligationCauseCode::Misc = self { None } else { Some(Arc::new(self)) },
169        }
170    }
171}
172
173impl<'tcx> std::ops::Deref for ObligationCauseCodeHandle<'tcx> {
174    type Target = ObligationCauseCode<'tcx>;
175
176    fn deref(&self) -> &Self::Target {
177        self.code.as_deref().unwrap_or(&ObligationCauseCode::Misc)
178    }
179}
180
181#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    ObligationCauseCode<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Misc => ObligationCauseCode::Misc,
            Self::SliceOrArrayElem => ObligationCauseCode::SliceOrArrayElem,
            Self::ArrayLen(__self_0) =>
                ObligationCauseCode::ArrayLen(::core::clone::Clone::clone(__self_0)),
            Self::TupleElem => ObligationCauseCode::TupleElem,
            Self::WhereClause(__self_0, __self_1) =>
                ObligationCauseCode::WhereClause(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::OpaqueTypeBound(__self_0, __self_1) =>
                ObligationCauseCode::OpaqueTypeBound(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::WhereClauseInExpr(__self_0, __self_1, __self_2, __self_3) =>
                ObligationCauseCode::WhereClauseInExpr(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2),
                    ::core::clone::Clone::clone(__self_3)),
            Self::HostEffectInExpr(__self_0, __self_1, __self_2, __self_3) =>
                ObligationCauseCode::HostEffectInExpr(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2),
                    ::core::clone::Clone::clone(__self_3)),
            Self::ReferenceOutlivesReferent(__self_0) =>
                ObligationCauseCode::ReferenceOutlivesReferent(::core::clone::Clone::clone(__self_0)),
            Self::ObjectTypeBound(__self_0, __self_1) =>
                ObligationCauseCode::ObjectTypeBound(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::Coercion { source: __self_0, target: __self_1 } =>
                ObligationCauseCode::Coercion {
                    source: ::core::clone::Clone::clone(__self_0),
                    target: ::core::clone::Clone::clone(__self_1),
                },
            Self::AssignmentLhsSized =>
                ObligationCauseCode::AssignmentLhsSized,
            Self::TupleInitializerSized =>
                ObligationCauseCode::TupleInitializerSized,
            Self::StructInitializerSized =>
                ObligationCauseCode::StructInitializerSized,
            Self::VariableType(__self_0) =>
                ObligationCauseCode::VariableType(::core::clone::Clone::clone(__self_0)),
            Self::SizedArgumentType(__self_0) =>
                ObligationCauseCode::SizedArgumentType(::core::clone::Clone::clone(__self_0)),
            Self::SizedReturnType => ObligationCauseCode::SizedReturnType,
            Self::SizedCallReturnType(__self_0) =>
                ObligationCauseCode::SizedCallReturnType(::core::clone::Clone::clone(__self_0)),
            Self::SizedYieldType => ObligationCauseCode::SizedYieldType,
            Self::InlineAsmSized => ObligationCauseCode::InlineAsmSized,
            Self::SizedClosureCapture(__self_0) =>
                ObligationCauseCode::SizedClosureCapture(::core::clone::Clone::clone(__self_0)),
            Self::SizedCoroutineInterior(__self_0) =>
                ObligationCauseCode::SizedCoroutineInterior(::core::clone::Clone::clone(__self_0)),
            Self::RepeatElementCopy {
                is_constable: __self_0, elt_span: __self_1 } =>
                ObligationCauseCode::RepeatElementCopy {
                    is_constable: ::core::clone::Clone::clone(__self_0),
                    elt_span: ::core::clone::Clone::clone(__self_1),
                },
            Self::FieldSized {
                adt_kind: __self_0, span: __self_1, last: __self_2 } =>
                ObligationCauseCode::FieldSized {
                    adt_kind: ::core::clone::Clone::clone(__self_0),
                    span: ::core::clone::Clone::clone(__self_1),
                    last: ::core::clone::Clone::clone(__self_2),
                },
            Self::SizedConstOrStatic =>
                ObligationCauseCode::SizedConstOrStatic,
            Self::SharedStatic => ObligationCauseCode::SharedStatic,
            Self::BuiltinDerived(__self_0) =>
                ObligationCauseCode::BuiltinDerived(::core::clone::Clone::clone(__self_0)),
            Self::ImplDerived(__self_0) =>
                ObligationCauseCode::ImplDerived(::core::clone::Clone::clone(__self_0)),
            Self::WellFormedDerived(__self_0) =>
                ObligationCauseCode::WellFormedDerived(::core::clone::Clone::clone(__self_0)),
            Self::ImplDerivedHost(__self_0) =>
                ObligationCauseCode::ImplDerivedHost(::core::clone::Clone::clone(__self_0)),
            Self::BuiltinDerivedHost(__self_0) =>
                ObligationCauseCode::BuiltinDerivedHost(::core::clone::Clone::clone(__self_0)),
            Self::FunctionArg {
                arg_hir_id: __self_0,
                call_hir_id: __self_1,
                parent_code: __self_2 } =>
                ObligationCauseCode::FunctionArg {
                    arg_hir_id: ::core::clone::Clone::clone(__self_0),
                    call_hir_id: ::core::clone::Clone::clone(__self_1),
                    parent_code: ::core::clone::Clone::clone(__self_2),
                },
            Self::CompareImplItem {
                impl_item_def_id: __self_0,
                trait_item_def_id: __self_1,
                kind: __self_2 } =>
                ObligationCauseCode::CompareImplItem {
                    impl_item_def_id: ::core::clone::Clone::clone(__self_0),
                    trait_item_def_id: ::core::clone::Clone::clone(__self_1),
                    kind: ::core::clone::Clone::clone(__self_2),
                },
            Self::CheckAssociatedTypeBounds {
                impl_item_def_id: __self_0, trait_item_def_id: __self_1 } =>
                ObligationCauseCode::CheckAssociatedTypeBounds {
                    impl_item_def_id: ::core::clone::Clone::clone(__self_0),
                    trait_item_def_id: ::core::clone::Clone::clone(__self_1),
                },
            Self::ExprAssignable => ObligationCauseCode::ExprAssignable,
            Self::MatchExpressionArm(__self_0) =>
                ObligationCauseCode::MatchExpressionArm(::core::clone::Clone::clone(__self_0)),
            Self::Pattern {
                span: __self_0, root_ty: __self_1, origin_expr: __self_2 } =>
                ObligationCauseCode::Pattern {
                    span: ::core::clone::Clone::clone(__self_0),
                    root_ty: ::core::clone::Clone::clone(__self_1),
                    origin_expr: ::core::clone::Clone::clone(__self_2),
                },
            Self::IfExpression {
                expr_id: __self_0,
                tail_defines_return_position_impl_trait: __self_1 } =>
                ObligationCauseCode::IfExpression {
                    expr_id: ::core::clone::Clone::clone(__self_0),
                    tail_defines_return_position_impl_trait: ::core::clone::Clone::clone(__self_1),
                },
            Self::IfExpressionWithNoElse =>
                ObligationCauseCode::IfExpressionWithNoElse,
            Self::MainFunctionType => ObligationCauseCode::MainFunctionType,
            Self::LangFunctionType(__self_0) =>
                ObligationCauseCode::LangFunctionType(::core::clone::Clone::clone(__self_0)),
            Self::IntrinsicType => ObligationCauseCode::IntrinsicType,
            Self::LetElse => ObligationCauseCode::LetElse,
            Self::MethodReceiver => ObligationCauseCode::MethodReceiver,
            Self::ReturnNoExpression =>
                ObligationCauseCode::ReturnNoExpression,
            Self::ReturnValue(__self_0) =>
                ObligationCauseCode::ReturnValue(::core::clone::Clone::clone(__self_0)),
            Self::OpaqueReturnType(__self_0) =>
                ObligationCauseCode::OpaqueReturnType(::core::clone::Clone::clone(__self_0)),
            Self::BlockTailExpression(__self_0, __self_1) =>
                ObligationCauseCode::BlockTailExpression(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::TrivialBound => ObligationCauseCode::TrivialBound,
            Self::AwaitableExpr(__self_0) =>
                ObligationCauseCode::AwaitableExpr(::core::clone::Clone::clone(__self_0)),
            Self::ForLoopIterator(__self_0) =>
                ObligationCauseCode::ForLoopIterator(::core::clone::Clone::clone(__self_0)),
            Self::QuestionMark => ObligationCauseCode::QuestionMark,
            Self::WellFormed(__self_0) =>
                ObligationCauseCode::WellFormed(::core::clone::Clone::clone(__self_0)),
            Self::MatchImpl(__self_0, __self_1) =>
                ObligationCauseCode::MatchImpl(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::UnOp { hir_id: __self_0 } =>
                ObligationCauseCode::UnOp {
                    hir_id: ::core::clone::Clone::clone(__self_0),
                },
            Self::BinOp {
                lhs_hir_id: __self_0,
                rhs_hir_id: __self_1,
                rhs_span: __self_2,
                rhs_is_lit: __self_3,
                output_ty: __self_4 } =>
                ObligationCauseCode::BinOp {
                    lhs_hir_id: ::core::clone::Clone::clone(__self_0),
                    rhs_hir_id: ::core::clone::Clone::clone(__self_1),
                    rhs_span: ::core::clone::Clone::clone(__self_2),
                    rhs_is_lit: ::core::clone::Clone::clone(__self_3),
                    output_ty: ::core::clone::Clone::clone(__self_4),
                },
            Self::AscribeUserTypeProvePredicate(__self_0, __self_1) =>
                ObligationCauseCode::AscribeUserTypeProvePredicate(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            Self::RustCall => ObligationCauseCode::RustCall,
            Self::DynCompatible(__self_0) =>
                ObligationCauseCode::DynCompatible(::core::clone::Clone::clone(__self_0)),
            Self::AlwaysApplicableImpl =>
                ObligationCauseCode::AlwaysApplicableImpl,
            Self::ConstParam(__self_0) =>
                ObligationCauseCode::ConstParam(::core::clone::Clone::clone(__self_0)),
            Self::ConstItemTy(__self_0) =>
                ObligationCauseCode::ConstItemTy(::core::clone::Clone::clone(__self_0)),
            Self::TypeAlias(__self_0, __self_1, __self_2) =>
                ObligationCauseCode::TypeAlias(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Self::UnsizedNonPlaceExpr(__self_0) =>
                ObligationCauseCode::UnsizedNonPlaceExpr(::core::clone::Clone::clone(__self_0)),
            Self::CompareEii { external_impl: __self_0, declaration: __self_1
                } =>
                ObligationCauseCode::CompareEii {
                    external_impl: ::core::clone::Clone::clone(__self_0),
                    declaration: ::core::clone::Clone::clone(__self_1),
                },
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    ObligationCauseCode<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Misc => ::core::fmt::Formatter::write_str(f, "Misc"),
            Self::SliceOrArrayElem =>
                ::core::fmt::Formatter::write_str(f, "SliceOrArrayElem"),
            Self::ArrayLen(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ArrayLen", &__self_0),
            Self::TupleElem =>
                ::core::fmt::Formatter::write_str(f, "TupleElem"),
            Self::WhereClause(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "WhereClause", __self_0, &__self_1),
            Self::OpaqueTypeBound(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "OpaqueTypeBound", __self_0, &__self_1),
            Self::WhereClauseInExpr(__self_0, __self_1, __self_2, __self_3) =>
                ::core::fmt::Formatter::debug_struct_field4_finish(f,
                    "WhereClauseInExpr", __self_0, __self_1, __self_2,
                    &__self_3),
            Self::HostEffectInExpr(__self_0, __self_1, __self_2, __self_3) =>
                ::core::fmt::Formatter::debug_struct_field4_finish(f,
                    "HostEffectInExpr", __self_0, __self_1, __self_2,
                    &__self_3),
            Self::ReferenceOutlivesReferent(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ReferenceOutlivesReferent", &__self_0),
            Self::ObjectTypeBound(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "ObjectTypeBound", __self_0, &__self_1),
            Self::Coercion { source: __self_0, target: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Coercion source target", __self_0, &__self_1),
            Self::AssignmentLhsSized =>
                ::core::fmt::Formatter::write_str(f, "AssignmentLhsSized"),
            Self::TupleInitializerSized =>
                ::core::fmt::Formatter::write_str(f, "TupleInitializerSized"),
            Self::StructInitializerSized =>
                ::core::fmt::Formatter::write_str(f,
                    "StructInitializerSized"),
            Self::VariableType(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "VariableType", &__self_0),
            Self::SizedArgumentType(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SizedArgumentType", &__self_0),
            Self::SizedReturnType =>
                ::core::fmt::Formatter::write_str(f, "SizedReturnType"),
            Self::SizedCallReturnType(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SizedCallReturnType", &__self_0),
            Self::SizedYieldType =>
                ::core::fmt::Formatter::write_str(f, "SizedYieldType"),
            Self::InlineAsmSized =>
                ::core::fmt::Formatter::write_str(f, "InlineAsmSized"),
            Self::SizedClosureCapture(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SizedClosureCapture", &__self_0),
            Self::SizedCoroutineInterior(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SizedCoroutineInterior", &__self_0),
            Self::RepeatElementCopy {
                is_constable: __self_0, elt_span: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "RepeatElementCopy is_constable elt_span", __self_0,
                    &__self_1),
            Self::FieldSized {
                adt_kind: __self_0, span: __self_1, last: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "FieldSized adt_kind span last", __self_0, __self_1,
                    &__self_2),
            Self::SizedConstOrStatic =>
                ::core::fmt::Formatter::write_str(f, "SizedConstOrStatic"),
            Self::SharedStatic =>
                ::core::fmt::Formatter::write_str(f, "SharedStatic"),
            Self::BuiltinDerived(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "BuiltinDerived", &__self_0),
            Self::ImplDerived(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ImplDerived", &__self_0),
            Self::WellFormedDerived(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "WellFormedDerived", &__self_0),
            Self::ImplDerivedHost(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ImplDerivedHost", &__self_0),
            Self::BuiltinDerivedHost(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "BuiltinDerivedHost", &__self_0),
            Self::FunctionArg {
                arg_hir_id: __self_0,
                call_hir_id: __self_1,
                parent_code: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "FunctionArg arg_hir_id call_hir_id parent_code", __self_0,
                    __self_1, &__self_2),
            Self::CompareImplItem {
                impl_item_def_id: __self_0,
                trait_item_def_id: __self_1,
                kind: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "CompareImplItem impl_item_def_id trait_item_def_id kind",
                    __self_0, __self_1, &__self_2),
            Self::CheckAssociatedTypeBounds {
                impl_item_def_id: __self_0, trait_item_def_id: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "CheckAssociatedTypeBounds impl_item_def_id trait_item_def_id",
                    __self_0, &__self_1),
            Self::ExprAssignable =>
                ::core::fmt::Formatter::write_str(f, "ExprAssignable"),
            Self::MatchExpressionArm(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "MatchExpressionArm", &__self_0),
            Self::Pattern {
                span: __self_0, root_ty: __self_1, origin_expr: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Pattern span root_ty origin_expr", __self_0, __self_1,
                    &__self_2),
            Self::IfExpression {
                expr_id: __self_0,
                tail_defines_return_position_impl_trait: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "IfExpression expr_id tail_defines_return_position_impl_trait",
                    __self_0, &__self_1),
            Self::IfExpressionWithNoElse =>
                ::core::fmt::Formatter::write_str(f,
                    "IfExpressionWithNoElse"),
            Self::MainFunctionType =>
                ::core::fmt::Formatter::write_str(f, "MainFunctionType"),
            Self::LangFunctionType(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "LangFunctionType", &__self_0),
            Self::IntrinsicType =>
                ::core::fmt::Formatter::write_str(f, "IntrinsicType"),
            Self::LetElse => ::core::fmt::Formatter::write_str(f, "LetElse"),
            Self::MethodReceiver =>
                ::core::fmt::Formatter::write_str(f, "MethodReceiver"),
            Self::ReturnNoExpression =>
                ::core::fmt::Formatter::write_str(f, "ReturnNoExpression"),
            Self::ReturnValue(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ReturnValue", &__self_0),
            Self::OpaqueReturnType(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "OpaqueReturnType", &__self_0),
            Self::BlockTailExpression(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "BlockTailExpression", __self_0, &__self_1),
            Self::TrivialBound =>
                ::core::fmt::Formatter::write_str(f, "TrivialBound"),
            Self::AwaitableExpr(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "AwaitableExpr", &__self_0),
            Self::ForLoopIterator(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ForLoopIterator", &__self_0),
            Self::QuestionMark =>
                ::core::fmt::Formatter::write_str(f, "QuestionMark"),
            Self::WellFormed(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "WellFormed", &__self_0),
            Self::MatchImpl(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "MatchImpl", __self_0, &__self_1),
            Self::UnOp { hir_id: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "UnOp hir_id", &__self_0),
            Self::BinOp {
                lhs_hir_id: __self_0,
                rhs_hir_id: __self_1,
                rhs_span: __self_2,
                rhs_is_lit: __self_3,
                output_ty: __self_4 } =>
                ::core::fmt::Formatter::debug_struct_field5_finish(f,
                    "BinOp lhs_hir_id rhs_hir_id rhs_span rhs_is_lit output_ty",
                    __self_0, __self_1, __self_2, __self_3, &__self_4),
            Self::AscribeUserTypeProvePredicate(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "AscribeUserTypeProvePredicate", __self_0, &__self_1),
            Self::RustCall =>
                ::core::fmt::Formatter::write_str(f, "RustCall"),
            Self::DynCompatible(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "DynCompatible", &__self_0),
            Self::AlwaysApplicableImpl =>
                ::core::fmt::Formatter::write_str(f, "AlwaysApplicableImpl"),
            Self::ConstParam(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ConstParam", &__self_0),
            Self::ConstItemTy(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ConstItemTy", &__self_0),
            Self::TypeAlias(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "TypeAlias", __self_0, __self_1, &__self_2),
            Self::UnsizedNonPlaceExpr(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "UnsizedNonPlaceExpr", &__self_0),
            Self::CompareEii { external_impl: __self_0, declaration: __self_1
                } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "CompareEii external_impl declaration", __self_0,
                    &__self_1),
        }
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    ObligationCauseCode<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    ObligationCauseCode<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::ArrayLen(__self_0), Self::ArrayLen(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::WhereClause(__self_0, __self_1),
                    Self::WhereClause(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::OpaqueTypeBound(__self_0, __self_1),
                    Self::OpaqueTypeBound(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::WhereClauseInExpr(__self_0, __self_1, __self_2,
                    __self_3),
                    Self::WhereClauseInExpr(__arg1_0, __arg1_1, __arg1_2,
                    __arg1_3)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                            __self_2 == __arg1_2 && __self_3 == __arg1_3,
                (Self::HostEffectInExpr(__self_0, __self_1, __self_2,
                    __self_3),
                    Self::HostEffectInExpr(__arg1_0, __arg1_1, __arg1_2,
                    __arg1_3)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                            __self_2 == __arg1_2 && __self_3 == __arg1_3,
                (Self::ReferenceOutlivesReferent(__self_0),
                    Self::ReferenceOutlivesReferent(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::ObjectTypeBound(__self_0, __self_1),
                    Self::ObjectTypeBound(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::Coercion { source: __self_0, target: __self_1 },
                    Self::Coercion { source: __arg1_0, target: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::VariableType(__self_0), Self::VariableType(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::SizedArgumentType(__self_0),
                    Self::SizedArgumentType(__arg1_0)) => __self_0 == __arg1_0,
                (Self::SizedCallReturnType(__self_0),
                    Self::SizedCallReturnType(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SizedClosureCapture(__self_0),
                    Self::SizedClosureCapture(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SizedCoroutineInterior(__self_0),
                    Self::SizedCoroutineInterior(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::RepeatElementCopy {
                    is_constable: __self_0, elt_span: __self_1 },
                    Self::RepeatElementCopy {
                    is_constable: __arg1_0, elt_span: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::FieldSized {
                    adt_kind: __self_0, span: __self_1, last: __self_2 },
                    Self::FieldSized {
                    adt_kind: __arg1_0, span: __arg1_1, last: __arg1_2 }) =>
                    __self_2 == __arg1_2 && __self_0 == __arg1_0 &&
                        __self_1 == __arg1_1,
                (Self::BuiltinDerived(__self_0),
                    Self::BuiltinDerived(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ImplDerived(__self_0), Self::ImplDerived(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::WellFormedDerived(__self_0),
                    Self::WellFormedDerived(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ImplDerivedHost(__self_0),
                    Self::ImplDerivedHost(__arg1_0)) => __self_0 == __arg1_0,
                (Self::BuiltinDerivedHost(__self_0),
                    Self::BuiltinDerivedHost(__arg1_0)) => __self_0 == __arg1_0,
                (Self::FunctionArg {
                    arg_hir_id: __self_0,
                    call_hir_id: __self_1,
                    parent_code: __self_2 }, Self::FunctionArg {
                    arg_hir_id: __arg1_0,
                    call_hir_id: __arg1_1,
                    parent_code: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::CompareImplItem {
                    impl_item_def_id: __self_0,
                    trait_item_def_id: __self_1,
                    kind: __self_2 }, Self::CompareImplItem {
                    impl_item_def_id: __arg1_0,
                    trait_item_def_id: __arg1_1,
                    kind: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::CheckAssociatedTypeBounds {
                    impl_item_def_id: __self_0, trait_item_def_id: __self_1 },
                    Self::CheckAssociatedTypeBounds {
                    impl_item_def_id: __arg1_0, trait_item_def_id: __arg1_1 })
                    => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::MatchExpressionArm(__self_0),
                    Self::MatchExpressionArm(__arg1_0)) => __self_0 == __arg1_0,
                (Self::Pattern {
                    span: __self_0, root_ty: __self_1, origin_expr: __self_2 },
                    Self::Pattern {
                    span: __arg1_0, root_ty: __arg1_1, origin_expr: __arg1_2 })
                    =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::IfExpression {
                    expr_id: __self_0,
                    tail_defines_return_position_impl_trait: __self_1 },
                    Self::IfExpression {
                    expr_id: __arg1_0,
                    tail_defines_return_position_impl_trait: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::LangFunctionType(__self_0),
                    Self::LangFunctionType(__arg1_0)) => __self_0 == __arg1_0,
                (Self::ReturnValue(__self_0), Self::ReturnValue(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::OpaqueReturnType(__self_0),
                    Self::OpaqueReturnType(__arg1_0)) => __self_0 == __arg1_0,
                (Self::BlockTailExpression(__self_0, __self_1),
                    Self::BlockTailExpression(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::AwaitableExpr(__self_0), Self::AwaitableExpr(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::ForLoopIterator(__self_0),
                    Self::ForLoopIterator(__arg1_0)) => __self_0 == __arg1_0,
                (Self::WellFormed(__self_0), Self::WellFormed(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::MatchImpl(__self_0, __self_1),
                    Self::MatchImpl(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::UnOp { hir_id: __self_0 }, Self::UnOp {
                    hir_id: __arg1_0 }) => __self_0 == __arg1_0,
                (Self::BinOp {
                    lhs_hir_id: __self_0,
                    rhs_hir_id: __self_1,
                    rhs_span: __self_2,
                    rhs_is_lit: __self_3,
                    output_ty: __self_4 }, Self::BinOp {
                    lhs_hir_id: __arg1_0,
                    rhs_hir_id: __arg1_1,
                    rhs_span: __arg1_2,
                    rhs_is_lit: __arg1_3,
                    output_ty: __arg1_4 }) =>
                    __self_3 == __arg1_3 && __self_0 == __arg1_0 &&
                                __self_1 == __arg1_1 && __self_2 == __arg1_2 &&
                        __self_4 == __arg1_4,
                (Self::AscribeUserTypeProvePredicate(__self_0, __self_1),
                    Self::AscribeUserTypeProvePredicate(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::DynCompatible(__self_0), Self::DynCompatible(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::ConstParam(__self_0), Self::ConstParam(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::ConstItemTy(__self_0), Self::ConstItemTy(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::TypeAlias(__self_0, __self_1, __self_2),
                    Self::TypeAlias(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::UnsizedNonPlaceExpr(__self_0),
                    Self::UnsizedNonPlaceExpr(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::CompareEii {
                    external_impl: __self_0, declaration: __self_1 },
                    Self::CompareEii {
                    external_impl: __arg1_0, declaration: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
    ObligationCauseCode<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<Option<LocalDefId>>;
        let _: ::core::cmp::AssertParamIsEq<HirId>;
        let _: ::core::cmp::AssertParamIsEq<usize>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ty::Region<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Option<HirId>>;
        let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
        let _: ::core::cmp::AssertParamIsEq<IsConstable>;
        let _: ::core::cmp::AssertParamIsEq<AdtKind>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
        let _: ::core::cmp::AssertParamIsEq<DerivedCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Box<ImplDerivedCause<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<DerivedCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Box<ImplDerivedHostCause<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<DerivedHostCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ty::AssocKind>;
        let _:
                ::core::cmp::AssertParamIsEq<Box<MatchExpressionArmCause<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<Option<Span>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Option<PatternOriginExpr>>;
        let _: ::core::cmp::AssertParamIsEq<Option<LocalDefId>>;
        let _: ::core::cmp::AssertParamIsEq<Symbol>;
        let _: ::core::cmp::AssertParamIsEq<Option<(Ty<'tcx>, HirId)>>;
        let _: ::core::cmp::AssertParamIsEq<hir::MatchSource>;
        let _: ::core::cmp::AssertParamIsEq<WellFormedLoc>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Option<Ty<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ObligationCauseCode<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ObligationCauseCode::Misc =>
                        0u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SliceOrArrayElem =>
                        1u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ArrayLen(ref __binding_0) =>
                        2u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::TupleElem =>
                        3u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::WhereClause(ref __binding_0,
                        ref __binding_1) => 4u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
                        ref __binding_1) => 5u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) =>
                        6u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::HostEffectInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) =>
                        7u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
                        => 8u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ObjectTypeBound(ref __binding_0,
                        ref __binding_1) => 9u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::Coercion {
                        source: ref __binding_0, target: ref __binding_1 } =>
                        10u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::AssignmentLhsSized =>
                        11u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::TupleInitializerSized =>
                        12u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::StructInitializerSized =>
                        13u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::VariableType(ref __binding_0) =>
                        14u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedArgumentType(ref __binding_0) =>
                        15u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedReturnType =>
                        16u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
                        17u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedYieldType =>
                        18u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::InlineAsmSized =>
                        19u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
                        20u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
                        => 21u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::RepeatElementCopy {
                        is_constable: ref __binding_0, elt_span: ref __binding_1 }
                        => 22u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::FieldSized {
                        adt_kind: ref __binding_0,
                        span: ref __binding_1,
                        last: ref __binding_2 } =>
                        23u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SizedConstOrStatic =>
                        24u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::SharedStatic =>
                        25u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::BuiltinDerived(ref __binding_0) =>
                        26u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ImplDerived(ref __binding_0) =>
                        27u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::WellFormedDerived(ref __binding_0) =>
                        28u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ImplDerivedHost(ref __binding_0) =>
                        29u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
                        30u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::FunctionArg {
                        arg_hir_id: ref __binding_0,
                        call_hir_id: ref __binding_1,
                        parent_code: ref __binding_2 } =>
                        31u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::CompareImplItem {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1,
                        kind: ref __binding_2 } =>
                        32u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1 } =>
                        33u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ExprAssignable =>
                        34u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
                        35u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::Pattern {
                        span: ref __binding_0,
                        root_ty: ref __binding_1,
                        origin_expr: ref __binding_2 } =>
                        36u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::IfExpression {
                        expr_id: ref __binding_0,
                        tail_defines_return_position_impl_trait: ref __binding_1 }
                        => 37u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::IfExpressionWithNoElse =>
                        38u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::MainFunctionType =>
                        39u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::LangFunctionType(ref __binding_0) =>
                        40u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::IntrinsicType =>
                        41u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::LetElse =>
                        42u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::MethodReceiver =>
                        43u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ReturnNoExpression =>
                        44u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ReturnValue(ref __binding_0) =>
                        45u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::OpaqueReturnType(ref __binding_0) =>
                        46u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::BlockTailExpression(ref __binding_0,
                        ref __binding_1) => 47u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::TrivialBound =>
                        48u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::AwaitableExpr(ref __binding_0) =>
                        49u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ForLoopIterator(ref __binding_0) =>
                        50u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::QuestionMark =>
                        51u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::WellFormed(ref __binding_0) =>
                        52u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::MatchImpl(ref __binding_0,
                        ref __binding_1) => 53u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::UnOp { hir_id: ref __binding_0 } =>
                        54u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::BinOp {
                        lhs_hir_id: ref __binding_0,
                        rhs_hir_id: ref __binding_1,
                        rhs_span: ref __binding_2,
                        rhs_is_lit: ref __binding_3,
                        output_ty: ref __binding_4 } =>
                        55u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
                        ref __binding_1) => 56u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::RustCall =>
                        57u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::DynCompatible(ref __binding_0) =>
                        58u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::AlwaysApplicableImpl =>
                        59u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ConstParam(ref __binding_0) =>
                        60u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::ConstItemTy(ref __binding_0) =>
                        61u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::TypeAlias(ref __binding_0,
                        ref __binding_1, ref __binding_2) =>
                        62u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                        63u8.stable_hash(__hcx, __hasher),
                    ObligationCauseCode::CompareEii {
                        external_impl: ref __binding_0, declaration: ref __binding_1
                        } => 64u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    ObligationCauseCode::Misc => {}
                    ObligationCauseCode::SliceOrArrayElem => {}
                    ObligationCauseCode::ArrayLen(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::TupleElem => {}
                    ObligationCauseCode::WhereClause(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::HostEffectInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ObjectTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::Coercion {
                        source: ref __binding_0, target: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::AssignmentLhsSized => {}
                    ObligationCauseCode::TupleInitializerSized => {}
                    ObligationCauseCode::StructInitializerSized => {}
                    ObligationCauseCode::VariableType(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedReturnType => {}
                    ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedYieldType => {}
                    ObligationCauseCode::InlineAsmSized => {}
                    ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::RepeatElementCopy {
                        is_constable: ref __binding_0, elt_span: ref __binding_1 }
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::FieldSized {
                        adt_kind: ref __binding_0,
                        span: ref __binding_1,
                        last: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedConstOrStatic => {}
                    ObligationCauseCode::SharedStatic => {}
                    ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ImplDerived(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::FunctionArg {
                        arg_hir_id: ref __binding_0,
                        call_hir_id: ref __binding_1,
                        parent_code: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::CompareImplItem {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1,
                        kind: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ExprAssignable => {}
                    ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::Pattern {
                        span: ref __binding_0,
                        root_ty: ref __binding_1,
                        origin_expr: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::IfExpression {
                        expr_id: ref __binding_0,
                        tail_defines_return_position_impl_trait: ref __binding_1 }
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::IfExpressionWithNoElse => {}
                    ObligationCauseCode::MainFunctionType => {}
                    ObligationCauseCode::LangFunctionType(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::IntrinsicType => {}
                    ObligationCauseCode::LetElse => {}
                    ObligationCauseCode::MethodReceiver => {}
                    ObligationCauseCode::ReturnNoExpression => {}
                    ObligationCauseCode::ReturnValue(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::BlockTailExpression(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::TrivialBound => {}
                    ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::QuestionMark => {}
                    ObligationCauseCode::WellFormed(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::MatchImpl(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::BinOp {
                        lhs_hir_id: ref __binding_0,
                        rhs_hir_id: ref __binding_1,
                        rhs_span: ref __binding_2,
                        rhs_is_lit: ref __binding_3,
                        output_ty: ref __binding_4 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::RustCall => {}
                    ObligationCauseCode::DynCompatible(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::AlwaysApplicableImpl => {}
                    ObligationCauseCode::ConstParam(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ConstItemTy(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::TypeAlias(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ObligationCauseCode::CompareEii {
                        external_impl: ref __binding_0, declaration: ref __binding_1
                        } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ObligationCauseCode<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        ObligationCauseCode::Misc => { 0usize }
                        ObligationCauseCode::SliceOrArrayElem => { 1usize }
                        ObligationCauseCode::ArrayLen(ref __binding_0) => { 2usize }
                        ObligationCauseCode::TupleElem => { 3usize }
                        ObligationCauseCode::WhereClause(ref __binding_0,
                            ref __binding_1) => {
                            4usize
                        }
                        ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
                            ref __binding_1) => {
                            5usize
                        }
                        ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
                            ref __binding_1, ref __binding_2, ref __binding_3) => {
                            6usize
                        }
                        ObligationCauseCode::HostEffectInExpr(ref __binding_0,
                            ref __binding_1, ref __binding_2, ref __binding_3) => {
                            7usize
                        }
                        ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
                            => {
                            8usize
                        }
                        ObligationCauseCode::ObjectTypeBound(ref __binding_0,
                            ref __binding_1) => {
                            9usize
                        }
                        ObligationCauseCode::Coercion {
                            source: ref __binding_0, target: ref __binding_1 } => {
                            10usize
                        }
                        ObligationCauseCode::AssignmentLhsSized => { 11usize }
                        ObligationCauseCode::TupleInitializerSized => { 12usize }
                        ObligationCauseCode::StructInitializerSized => { 13usize }
                        ObligationCauseCode::VariableType(ref __binding_0) => {
                            14usize
                        }
                        ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
                            15usize
                        }
                        ObligationCauseCode::SizedReturnType => { 16usize }
                        ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
                            {
                            17usize
                        }
                        ObligationCauseCode::SizedYieldType => { 18usize }
                        ObligationCauseCode::InlineAsmSized => { 19usize }
                        ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
                            {
                            20usize
                        }
                        ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
                            => {
                            21usize
                        }
                        ObligationCauseCode::RepeatElementCopy {
                            is_constable: ref __binding_0, elt_span: ref __binding_1 }
                            => {
                            22usize
                        }
                        ObligationCauseCode::FieldSized {
                            adt_kind: ref __binding_0,
                            span: ref __binding_1,
                            last: ref __binding_2 } => {
                            23usize
                        }
                        ObligationCauseCode::SizedConstOrStatic => { 24usize }
                        ObligationCauseCode::SharedStatic => { 25usize }
                        ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
                            26usize
                        }
                        ObligationCauseCode::ImplDerived(ref __binding_0) => {
                            27usize
                        }
                        ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
                            28usize
                        }
                        ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
                            29usize
                        }
                        ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
                            {
                            30usize
                        }
                        ObligationCauseCode::FunctionArg {
                            arg_hir_id: ref __binding_0,
                            call_hir_id: ref __binding_1,
                            parent_code: ref __binding_2 } => {
                            31usize
                        }
                        ObligationCauseCode::CompareImplItem {
                            impl_item_def_id: ref __binding_0,
                            trait_item_def_id: ref __binding_1,
                            kind: ref __binding_2 } => {
                            32usize
                        }
                        ObligationCauseCode::CheckAssociatedTypeBounds {
                            impl_item_def_id: ref __binding_0,
                            trait_item_def_id: ref __binding_1 } => {
                            33usize
                        }
                        ObligationCauseCode::ExprAssignable => { 34usize }
                        ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
                            {
                            35usize
                        }
                        ObligationCauseCode::Pattern {
                            span: ref __binding_0,
                            root_ty: ref __binding_1,
                            origin_expr: ref __binding_2 } => {
                            36usize
                        }
                        ObligationCauseCode::IfExpression {
                            expr_id: ref __binding_0,
                            tail_defines_return_position_impl_trait: ref __binding_1 }
                            => {
                            37usize
                        }
                        ObligationCauseCode::IfExpressionWithNoElse => { 38usize }
                        ObligationCauseCode::MainFunctionType => { 39usize }
                        ObligationCauseCode::LangFunctionType(ref __binding_0) => {
                            40usize
                        }
                        ObligationCauseCode::IntrinsicType => { 41usize }
                        ObligationCauseCode::LetElse => { 42usize }
                        ObligationCauseCode::MethodReceiver => { 43usize }
                        ObligationCauseCode::ReturnNoExpression => { 44usize }
                        ObligationCauseCode::ReturnValue(ref __binding_0) => {
                            45usize
                        }
                        ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
                            46usize
                        }
                        ObligationCauseCode::BlockTailExpression(ref __binding_0,
                            ref __binding_1) => {
                            47usize
                        }
                        ObligationCauseCode::TrivialBound => { 48usize }
                        ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
                            49usize
                        }
                        ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
                            50usize
                        }
                        ObligationCauseCode::QuestionMark => { 51usize }
                        ObligationCauseCode::WellFormed(ref __binding_0) => {
                            52usize
                        }
                        ObligationCauseCode::MatchImpl(ref __binding_0,
                            ref __binding_1) => {
                            53usize
                        }
                        ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
                            54usize
                        }
                        ObligationCauseCode::BinOp {
                            lhs_hir_id: ref __binding_0,
                            rhs_hir_id: ref __binding_1,
                            rhs_span: ref __binding_2,
                            rhs_is_lit: ref __binding_3,
                            output_ty: ref __binding_4 } => {
                            55usize
                        }
                        ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
                            ref __binding_1) => {
                            56usize
                        }
                        ObligationCauseCode::RustCall => { 57usize }
                        ObligationCauseCode::DynCompatible(ref __binding_0) => {
                            58usize
                        }
                        ObligationCauseCode::AlwaysApplicableImpl => { 59usize }
                        ObligationCauseCode::ConstParam(ref __binding_0) => {
                            60usize
                        }
                        ObligationCauseCode::ConstItemTy(ref __binding_0) => {
                            61usize
                        }
                        ObligationCauseCode::TypeAlias(ref __binding_0,
                            ref __binding_1, ref __binding_2) => {
                            62usize
                        }
                        ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                            {
                            63usize
                        }
                        ObligationCauseCode::CompareEii {
                            external_impl: ref __binding_0, declaration: ref __binding_1
                            } => {
                            64usize
                        }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    ObligationCauseCode::Misc => {}
                    ObligationCauseCode::SliceOrArrayElem => {}
                    ObligationCauseCode::ArrayLen(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::TupleElem => {}
                    ObligationCauseCode::WhereClause(ref __binding_0,
                        ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                            __encoder);
                    }
                    ObligationCauseCode::HostEffectInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                            __encoder);
                    }
                    ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
                        => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::ObjectTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::Coercion {
                        source: ref __binding_0, target: ref __binding_1 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::AssignmentLhsSized => {}
                    ObligationCauseCode::TupleInitializerSized => {}
                    ObligationCauseCode::StructInitializerSized => {}
                    ObligationCauseCode::VariableType(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::SizedReturnType => {}
                    ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
                        {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::SizedYieldType => {}
                    ObligationCauseCode::InlineAsmSized => {}
                    ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
                        {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
                        => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::RepeatElementCopy {
                        is_constable: ref __binding_0, elt_span: ref __binding_1 }
                        => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::FieldSized {
                        adt_kind: ref __binding_0,
                        span: ref __binding_1,
                        last: ref __binding_2 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                    ObligationCauseCode::SizedConstOrStatic => {}
                    ObligationCauseCode::SharedStatic => {}
                    ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::ImplDerived(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
                        {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::FunctionArg {
                        arg_hir_id: ref __binding_0,
                        call_hir_id: ref __binding_1,
                        parent_code: ref __binding_2 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                    ObligationCauseCode::CompareImplItem {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1,
                        kind: ref __binding_2 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::ExprAssignable => {}
                    ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
                        {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::Pattern {
                        span: ref __binding_0,
                        root_ty: ref __binding_1,
                        origin_expr: ref __binding_2 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                    ObligationCauseCode::IfExpression {
                        expr_id: ref __binding_0,
                        tail_defines_return_position_impl_trait: ref __binding_1 }
                        => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::IfExpressionWithNoElse => {}
                    ObligationCauseCode::MainFunctionType => {}
                    ObligationCauseCode::LangFunctionType(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::IntrinsicType => {}
                    ObligationCauseCode::LetElse => {}
                    ObligationCauseCode::MethodReceiver => {}
                    ObligationCauseCode::ReturnNoExpression => {}
                    ObligationCauseCode::ReturnValue(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::BlockTailExpression(ref __binding_0,
                        ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::TrivialBound => {}
                    ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::QuestionMark => {}
                    ObligationCauseCode::WellFormed(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::MatchImpl(ref __binding_0,
                        ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::BinOp {
                        lhs_hir_id: ref __binding_0,
                        rhs_hir_id: ref __binding_1,
                        rhs_span: ref __binding_2,
                        rhs_is_lit: ref __binding_3,
                        output_ty: ref __binding_4 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_4,
                            __encoder);
                    }
                    ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
                        ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    ObligationCauseCode::RustCall => {}
                    ObligationCauseCode::DynCompatible(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::AlwaysApplicableImpl => {}
                    ObligationCauseCode::ConstParam(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::ConstItemTy(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::TypeAlias(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                    ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                        {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ObligationCauseCode::CompareEii {
                        external_impl: ref __binding_0, declaration: ref __binding_1
                        } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for ObligationCauseCode<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { ObligationCauseCode::Misc }
                    1usize => { ObligationCauseCode::SliceOrArrayElem }
                    2usize => {
                        ObligationCauseCode::ArrayLen(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    3usize => { ObligationCauseCode::TupleElem }
                    4usize => {
                        ObligationCauseCode::WhereClause(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    5usize => {
                        ObligationCauseCode::OpaqueTypeBound(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    6usize => {
                        ObligationCauseCode::WhereClauseInExpr(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    7usize => {
                        ObligationCauseCode::HostEffectInExpr(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    8usize => {
                        ObligationCauseCode::ReferenceOutlivesReferent(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    9usize => {
                        ObligationCauseCode::ObjectTypeBound(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    10usize => {
                        ObligationCauseCode::Coercion {
                            source: ::rustc_serialize::Decodable::decode(__decoder),
                            target: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    11usize => { ObligationCauseCode::AssignmentLhsSized }
                    12usize => { ObligationCauseCode::TupleInitializerSized }
                    13usize => { ObligationCauseCode::StructInitializerSized }
                    14usize => {
                        ObligationCauseCode::VariableType(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    15usize => {
                        ObligationCauseCode::SizedArgumentType(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    16usize => { ObligationCauseCode::SizedReturnType }
                    17usize => {
                        ObligationCauseCode::SizedCallReturnType(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    18usize => { ObligationCauseCode::SizedYieldType }
                    19usize => { ObligationCauseCode::InlineAsmSized }
                    20usize => {
                        ObligationCauseCode::SizedClosureCapture(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    21usize => {
                        ObligationCauseCode::SizedCoroutineInterior(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    22usize => {
                        ObligationCauseCode::RepeatElementCopy {
                            is_constable: ::rustc_serialize::Decodable::decode(__decoder),
                            elt_span: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    23usize => {
                        ObligationCauseCode::FieldSized {
                            adt_kind: ::rustc_serialize::Decodable::decode(__decoder),
                            span: ::rustc_serialize::Decodable::decode(__decoder),
                            last: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    24usize => { ObligationCauseCode::SizedConstOrStatic }
                    25usize => { ObligationCauseCode::SharedStatic }
                    26usize => {
                        ObligationCauseCode::BuiltinDerived(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    27usize => {
                        ObligationCauseCode::ImplDerived(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    28usize => {
                        ObligationCauseCode::WellFormedDerived(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    29usize => {
                        ObligationCauseCode::ImplDerivedHost(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    30usize => {
                        ObligationCauseCode::BuiltinDerivedHost(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    31usize => {
                        ObligationCauseCode::FunctionArg {
                            arg_hir_id: ::rustc_serialize::Decodable::decode(__decoder),
                            call_hir_id: ::rustc_serialize::Decodable::decode(__decoder),
                            parent_code: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    32usize => {
                        ObligationCauseCode::CompareImplItem {
                            impl_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                            trait_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                            kind: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    33usize => {
                        ObligationCauseCode::CheckAssociatedTypeBounds {
                            impl_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                            trait_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    34usize => { ObligationCauseCode::ExprAssignable }
                    35usize => {
                        ObligationCauseCode::MatchExpressionArm(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    36usize => {
                        ObligationCauseCode::Pattern {
                            span: ::rustc_serialize::Decodable::decode(__decoder),
                            root_ty: ::rustc_serialize::Decodable::decode(__decoder),
                            origin_expr: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    37usize => {
                        ObligationCauseCode::IfExpression {
                            expr_id: ::rustc_serialize::Decodable::decode(__decoder),
                            tail_defines_return_position_impl_trait: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    38usize => { ObligationCauseCode::IfExpressionWithNoElse }
                    39usize => { ObligationCauseCode::MainFunctionType }
                    40usize => {
                        ObligationCauseCode::LangFunctionType(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    41usize => { ObligationCauseCode::IntrinsicType }
                    42usize => { ObligationCauseCode::LetElse }
                    43usize => { ObligationCauseCode::MethodReceiver }
                    44usize => { ObligationCauseCode::ReturnNoExpression }
                    45usize => {
                        ObligationCauseCode::ReturnValue(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    46usize => {
                        ObligationCauseCode::OpaqueReturnType(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    47usize => {
                        ObligationCauseCode::BlockTailExpression(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    48usize => { ObligationCauseCode::TrivialBound }
                    49usize => {
                        ObligationCauseCode::AwaitableExpr(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    50usize => {
                        ObligationCauseCode::ForLoopIterator(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    51usize => { ObligationCauseCode::QuestionMark }
                    52usize => {
                        ObligationCauseCode::WellFormed(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    53usize => {
                        ObligationCauseCode::MatchImpl(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    54usize => {
                        ObligationCauseCode::UnOp {
                            hir_id: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    55usize => {
                        ObligationCauseCode::BinOp {
                            lhs_hir_id: ::rustc_serialize::Decodable::decode(__decoder),
                            rhs_hir_id: ::rustc_serialize::Decodable::decode(__decoder),
                            rhs_span: ::rustc_serialize::Decodable::decode(__decoder),
                            rhs_is_lit: ::rustc_serialize::Decodable::decode(__decoder),
                            output_ty: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    56usize => {
                        ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    57usize => { ObligationCauseCode::RustCall }
                    58usize => {
                        ObligationCauseCode::DynCompatible(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    59usize => { ObligationCauseCode::AlwaysApplicableImpl }
                    60usize => {
                        ObligationCauseCode::ConstParam(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    61usize => {
                        ObligationCauseCode::ConstItemTy(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    62usize => {
                        ObligationCauseCode::TypeAlias(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    63usize => {
                        ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    64usize => {
                        ObligationCauseCode::CompareEii {
                            external_impl: ::rustc_serialize::Decodable::decode(__decoder),
                            declaration: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `ObligationCauseCode`, expected 0..65, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable)]
182#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ObligationCauseCode<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ObligationCauseCode::Misc => {}
                    ObligationCauseCode::SliceOrArrayElem => {}
                    ObligationCauseCode::ArrayLen(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::TupleElem => {}
                    ObligationCauseCode::WhereClause(ref __binding_0,
                        ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::HostEffectInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
                        => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ObjectTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::Coercion {
                        source: ref __binding_0, target: ref __binding_1 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::AssignmentLhsSized => {}
                    ObligationCauseCode::TupleInitializerSized => {}
                    ObligationCauseCode::StructInitializerSized => {}
                    ObligationCauseCode::VariableType(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::SizedReturnType => {}
                    ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::SizedYieldType => {}
                    ObligationCauseCode::InlineAsmSized => {}
                    ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
                        => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::RepeatElementCopy {
                        is_constable: ref __binding_0, elt_span: ref __binding_1 }
                        => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::FieldSized {
                        adt_kind: ref __binding_0,
                        span: ref __binding_1,
                        last: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::SizedConstOrStatic => {}
                    ObligationCauseCode::SharedStatic => {}
                    ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ImplDerived(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::FunctionArg {
                        arg_hir_id: ref __binding_0,
                        call_hir_id: ref __binding_1,
                        parent_code: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::CompareImplItem {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1,
                        kind: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ExprAssignable => {}
                    ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::Pattern {
                        span: ref __binding_0,
                        root_ty: ref __binding_1,
                        origin_expr: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::IfExpression {
                        expr_id: ref __binding_0,
                        tail_defines_return_position_impl_trait: ref __binding_1 }
                        => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::IfExpressionWithNoElse => {}
                    ObligationCauseCode::MainFunctionType => {}
                    ObligationCauseCode::LangFunctionType(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::IntrinsicType => {}
                    ObligationCauseCode::LetElse => {}
                    ObligationCauseCode::MethodReceiver => {}
                    ObligationCauseCode::ReturnNoExpression => {}
                    ObligationCauseCode::ReturnValue(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::BlockTailExpression(ref __binding_0,
                        ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::TrivialBound => {}
                    ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::QuestionMark => {}
                    ObligationCauseCode::WellFormed(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::MatchImpl(ref __binding_0,
                        ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::BinOp {
                        lhs_hir_id: ref __binding_0,
                        rhs_hir_id: ref __binding_1,
                        rhs_span: ref __binding_2,
                        rhs_is_lit: ref __binding_3,
                        output_ty: ref __binding_4 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_4,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
                        ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::RustCall => {}
                    ObligationCauseCode::DynCompatible(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::AlwaysApplicableImpl => {}
                    ObligationCauseCode::ConstParam(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::ConstItemTy(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::TypeAlias(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                        {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ObligationCauseCode::CompareEii {
                        external_impl: ref __binding_0, declaration: ref __binding_1
                        } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ObligationCauseCode<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ObligationCauseCode::Misc => { ObligationCauseCode::Misc }
                        ObligationCauseCode::SliceOrArrayElem => {
                            ObligationCauseCode::SliceOrArrayElem
                        }
                        ObligationCauseCode::ArrayLen(__binding_0) => {
                            ObligationCauseCode::ArrayLen(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::TupleElem => {
                            ObligationCauseCode::TupleElem
                        }
                        ObligationCauseCode::WhereClause(__binding_0, __binding_1)
                            => {
                            ObligationCauseCode::WhereClause(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                        ObligationCauseCode::OpaqueTypeBound(__binding_0,
                            __binding_1) => {
                            ObligationCauseCode::OpaqueTypeBound(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                        ObligationCauseCode::WhereClauseInExpr(__binding_0,
                            __binding_1, __binding_2, __binding_3) => {
                            ObligationCauseCode::WhereClauseInExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
                                        __folder)?)
                        }
                        ObligationCauseCode::HostEffectInExpr(__binding_0,
                            __binding_1, __binding_2, __binding_3) => {
                            ObligationCauseCode::HostEffectInExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
                                        __folder)?)
                        }
                        ObligationCauseCode::ReferenceOutlivesReferent(__binding_0)
                            => {
                            ObligationCauseCode::ReferenceOutlivesReferent(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::ObjectTypeBound(__binding_0,
                            __binding_1) => {
                            ObligationCauseCode::ObjectTypeBound(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                        ObligationCauseCode::Coercion {
                            source: __binding_0, target: __binding_1 } => {
                            ObligationCauseCode::Coercion {
                                source: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                target: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::AssignmentLhsSized => {
                            ObligationCauseCode::AssignmentLhsSized
                        }
                        ObligationCauseCode::TupleInitializerSized => {
                            ObligationCauseCode::TupleInitializerSized
                        }
                        ObligationCauseCode::StructInitializerSized => {
                            ObligationCauseCode::StructInitializerSized
                        }
                        ObligationCauseCode::VariableType(__binding_0) => {
                            ObligationCauseCode::VariableType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::SizedArgumentType(__binding_0) => {
                            ObligationCauseCode::SizedArgumentType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::SizedReturnType => {
                            ObligationCauseCode::SizedReturnType
                        }
                        ObligationCauseCode::SizedCallReturnType(__binding_0) => {
                            ObligationCauseCode::SizedCallReturnType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::SizedYieldType => {
                            ObligationCauseCode::SizedYieldType
                        }
                        ObligationCauseCode::InlineAsmSized => {
                            ObligationCauseCode::InlineAsmSized
                        }
                        ObligationCauseCode::SizedClosureCapture(__binding_0) => {
                            ObligationCauseCode::SizedClosureCapture(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::SizedCoroutineInterior(__binding_0) =>
                            {
                            ObligationCauseCode::SizedCoroutineInterior(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::RepeatElementCopy {
                            is_constable: __binding_0, elt_span: __binding_1 } => {
                            ObligationCauseCode::RepeatElementCopy {
                                is_constable: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                elt_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::FieldSized {
                            adt_kind: __binding_0, span: __binding_1, last: __binding_2
                            } => {
                            ObligationCauseCode::FieldSized {
                                adt_kind: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                last: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::SizedConstOrStatic => {
                            ObligationCauseCode::SizedConstOrStatic
                        }
                        ObligationCauseCode::SharedStatic => {
                            ObligationCauseCode::SharedStatic
                        }
                        ObligationCauseCode::BuiltinDerived(__binding_0) => {
                            ObligationCauseCode::BuiltinDerived(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::ImplDerived(__binding_0) => {
                            ObligationCauseCode::ImplDerived(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::WellFormedDerived(__binding_0) => {
                            ObligationCauseCode::WellFormedDerived(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::ImplDerivedHost(__binding_0) => {
                            ObligationCauseCode::ImplDerivedHost(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::BuiltinDerivedHost(__binding_0) => {
                            ObligationCauseCode::BuiltinDerivedHost(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::FunctionArg {
                            arg_hir_id: __binding_0,
                            call_hir_id: __binding_1,
                            parent_code: __binding_2 } => {
                            ObligationCauseCode::FunctionArg {
                                arg_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                call_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                parent_code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::CompareImplItem {
                            impl_item_def_id: __binding_0,
                            trait_item_def_id: __binding_1,
                            kind: __binding_2 } => {
                            ObligationCauseCode::CompareImplItem {
                                impl_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                trait_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                kind: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::CheckAssociatedTypeBounds {
                            impl_item_def_id: __binding_0,
                            trait_item_def_id: __binding_1 } => {
                            ObligationCauseCode::CheckAssociatedTypeBounds {
                                impl_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                trait_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::ExprAssignable => {
                            ObligationCauseCode::ExprAssignable
                        }
                        ObligationCauseCode::MatchExpressionArm(__binding_0) => {
                            ObligationCauseCode::MatchExpressionArm(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::Pattern {
                            span: __binding_0,
                            root_ty: __binding_1,
                            origin_expr: __binding_2 } => {
                            ObligationCauseCode::Pattern {
                                span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                root_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                origin_expr: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::IfExpression {
                            expr_id: __binding_0,
                            tail_defines_return_position_impl_trait: __binding_1 } => {
                            ObligationCauseCode::IfExpression {
                                expr_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                tail_defines_return_position_impl_trait: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::IfExpressionWithNoElse => {
                            ObligationCauseCode::IfExpressionWithNoElse
                        }
                        ObligationCauseCode::MainFunctionType => {
                            ObligationCauseCode::MainFunctionType
                        }
                        ObligationCauseCode::LangFunctionType(__binding_0) => {
                            ObligationCauseCode::LangFunctionType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::IntrinsicType => {
                            ObligationCauseCode::IntrinsicType
                        }
                        ObligationCauseCode::LetElse => {
                            ObligationCauseCode::LetElse
                        }
                        ObligationCauseCode::MethodReceiver => {
                            ObligationCauseCode::MethodReceiver
                        }
                        ObligationCauseCode::ReturnNoExpression => {
                            ObligationCauseCode::ReturnNoExpression
                        }
                        ObligationCauseCode::ReturnValue(__binding_0) => {
                            ObligationCauseCode::ReturnValue(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::OpaqueReturnType(__binding_0) => {
                            ObligationCauseCode::OpaqueReturnType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::BlockTailExpression(__binding_0,
                            __binding_1) => {
                            ObligationCauseCode::BlockTailExpression(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                        ObligationCauseCode::TrivialBound => {
                            ObligationCauseCode::TrivialBound
                        }
                        ObligationCauseCode::AwaitableExpr(__binding_0) => {
                            ObligationCauseCode::AwaitableExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::ForLoopIterator(__binding_0) => {
                            ObligationCauseCode::ForLoopIterator(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::QuestionMark => {
                            ObligationCauseCode::QuestionMark
                        }
                        ObligationCauseCode::WellFormed(__binding_0) => {
                            ObligationCauseCode::WellFormed(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::MatchImpl(__binding_0, __binding_1) =>
                            {
                            ObligationCauseCode::MatchImpl(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                        ObligationCauseCode::UnOp { hir_id: __binding_0 } => {
                            ObligationCauseCode::UnOp {
                                hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::BinOp {
                            lhs_hir_id: __binding_0,
                            rhs_hir_id: __binding_1,
                            rhs_span: __binding_2,
                            rhs_is_lit: __binding_3,
                            output_ty: __binding_4 } => {
                            ObligationCauseCode::BinOp {
                                lhs_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                rhs_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                rhs_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                                rhs_is_lit: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
                                        __folder)?,
                                output_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_4,
                                        __folder)?,
                            }
                        }
                        ObligationCauseCode::AscribeUserTypeProvePredicate(__binding_0,
                            __binding_1) => {
                            ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                        ObligationCauseCode::RustCall => {
                            ObligationCauseCode::RustCall
                        }
                        ObligationCauseCode::DynCompatible(__binding_0) => {
                            ObligationCauseCode::DynCompatible(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::AlwaysApplicableImpl => {
                            ObligationCauseCode::AlwaysApplicableImpl
                        }
                        ObligationCauseCode::ConstParam(__binding_0) => {
                            ObligationCauseCode::ConstParam(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::ConstItemTy(__binding_0) => {
                            ObligationCauseCode::ConstItemTy(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::TypeAlias(__binding_0, __binding_1,
                            __binding_2) => {
                            ObligationCauseCode::TypeAlias(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?)
                        }
                        ObligationCauseCode::UnsizedNonPlaceExpr(__binding_0) => {
                            ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ObligationCauseCode::CompareEii {
                            external_impl: __binding_0, declaration: __binding_1 } => {
                            ObligationCauseCode::CompareEii {
                                external_impl: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                declaration: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ObligationCauseCode::Misc => { ObligationCauseCode::Misc }
                    ObligationCauseCode::SliceOrArrayElem => {
                        ObligationCauseCode::SliceOrArrayElem
                    }
                    ObligationCauseCode::ArrayLen(__binding_0) => {
                        ObligationCauseCode::ArrayLen(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::TupleElem => {
                        ObligationCauseCode::TupleElem
                    }
                    ObligationCauseCode::WhereClause(__binding_0, __binding_1)
                        => {
                        ObligationCauseCode::WhereClause(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                    ObligationCauseCode::OpaqueTypeBound(__binding_0,
                        __binding_1) => {
                        ObligationCauseCode::OpaqueTypeBound(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                    ObligationCauseCode::WhereClauseInExpr(__binding_0,
                        __binding_1, __binding_2, __binding_3) => {
                        ObligationCauseCode::WhereClauseInExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
                                __folder))
                    }
                    ObligationCauseCode::HostEffectInExpr(__binding_0,
                        __binding_1, __binding_2, __binding_3) => {
                        ObligationCauseCode::HostEffectInExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
                                __folder))
                    }
                    ObligationCauseCode::ReferenceOutlivesReferent(__binding_0)
                        => {
                        ObligationCauseCode::ReferenceOutlivesReferent(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::ObjectTypeBound(__binding_0,
                        __binding_1) => {
                        ObligationCauseCode::ObjectTypeBound(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                    ObligationCauseCode::Coercion {
                        source: __binding_0, target: __binding_1 } => {
                        ObligationCauseCode::Coercion {
                            source: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            target: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                    ObligationCauseCode::AssignmentLhsSized => {
                        ObligationCauseCode::AssignmentLhsSized
                    }
                    ObligationCauseCode::TupleInitializerSized => {
                        ObligationCauseCode::TupleInitializerSized
                    }
                    ObligationCauseCode::StructInitializerSized => {
                        ObligationCauseCode::StructInitializerSized
                    }
                    ObligationCauseCode::VariableType(__binding_0) => {
                        ObligationCauseCode::VariableType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::SizedArgumentType(__binding_0) => {
                        ObligationCauseCode::SizedArgumentType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::SizedReturnType => {
                        ObligationCauseCode::SizedReturnType
                    }
                    ObligationCauseCode::SizedCallReturnType(__binding_0) => {
                        ObligationCauseCode::SizedCallReturnType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::SizedYieldType => {
                        ObligationCauseCode::SizedYieldType
                    }
                    ObligationCauseCode::InlineAsmSized => {
                        ObligationCauseCode::InlineAsmSized
                    }
                    ObligationCauseCode::SizedClosureCapture(__binding_0) => {
                        ObligationCauseCode::SizedClosureCapture(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::SizedCoroutineInterior(__binding_0) =>
                        {
                        ObligationCauseCode::SizedCoroutineInterior(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::RepeatElementCopy {
                        is_constable: __binding_0, elt_span: __binding_1 } => {
                        ObligationCauseCode::RepeatElementCopy {
                            is_constable: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            elt_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                    ObligationCauseCode::FieldSized {
                        adt_kind: __binding_0, span: __binding_1, last: __binding_2
                        } => {
                        ObligationCauseCode::FieldSized {
                            adt_kind: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            last: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                    ObligationCauseCode::SizedConstOrStatic => {
                        ObligationCauseCode::SizedConstOrStatic
                    }
                    ObligationCauseCode::SharedStatic => {
                        ObligationCauseCode::SharedStatic
                    }
                    ObligationCauseCode::BuiltinDerived(__binding_0) => {
                        ObligationCauseCode::BuiltinDerived(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::ImplDerived(__binding_0) => {
                        ObligationCauseCode::ImplDerived(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::WellFormedDerived(__binding_0) => {
                        ObligationCauseCode::WellFormedDerived(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::ImplDerivedHost(__binding_0) => {
                        ObligationCauseCode::ImplDerivedHost(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::BuiltinDerivedHost(__binding_0) => {
                        ObligationCauseCode::BuiltinDerivedHost(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::FunctionArg {
                        arg_hir_id: __binding_0,
                        call_hir_id: __binding_1,
                        parent_code: __binding_2 } => {
                        ObligationCauseCode::FunctionArg {
                            arg_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            call_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            parent_code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                    ObligationCauseCode::CompareImplItem {
                        impl_item_def_id: __binding_0,
                        trait_item_def_id: __binding_1,
                        kind: __binding_2 } => {
                        ObligationCauseCode::CompareImplItem {
                            impl_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            trait_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            kind: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                        impl_item_def_id: __binding_0,
                        trait_item_def_id: __binding_1 } => {
                        ObligationCauseCode::CheckAssociatedTypeBounds {
                            impl_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            trait_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                    ObligationCauseCode::ExprAssignable => {
                        ObligationCauseCode::ExprAssignable
                    }
                    ObligationCauseCode::MatchExpressionArm(__binding_0) => {
                        ObligationCauseCode::MatchExpressionArm(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::Pattern {
                        span: __binding_0,
                        root_ty: __binding_1,
                        origin_expr: __binding_2 } => {
                        ObligationCauseCode::Pattern {
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            root_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            origin_expr: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                    ObligationCauseCode::IfExpression {
                        expr_id: __binding_0,
                        tail_defines_return_position_impl_trait: __binding_1 } => {
                        ObligationCauseCode::IfExpression {
                            expr_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            tail_defines_return_position_impl_trait: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                    ObligationCauseCode::IfExpressionWithNoElse => {
                        ObligationCauseCode::IfExpressionWithNoElse
                    }
                    ObligationCauseCode::MainFunctionType => {
                        ObligationCauseCode::MainFunctionType
                    }
                    ObligationCauseCode::LangFunctionType(__binding_0) => {
                        ObligationCauseCode::LangFunctionType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::IntrinsicType => {
                        ObligationCauseCode::IntrinsicType
                    }
                    ObligationCauseCode::LetElse => {
                        ObligationCauseCode::LetElse
                    }
                    ObligationCauseCode::MethodReceiver => {
                        ObligationCauseCode::MethodReceiver
                    }
                    ObligationCauseCode::ReturnNoExpression => {
                        ObligationCauseCode::ReturnNoExpression
                    }
                    ObligationCauseCode::ReturnValue(__binding_0) => {
                        ObligationCauseCode::ReturnValue(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::OpaqueReturnType(__binding_0) => {
                        ObligationCauseCode::OpaqueReturnType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::BlockTailExpression(__binding_0,
                        __binding_1) => {
                        ObligationCauseCode::BlockTailExpression(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                    ObligationCauseCode::TrivialBound => {
                        ObligationCauseCode::TrivialBound
                    }
                    ObligationCauseCode::AwaitableExpr(__binding_0) => {
                        ObligationCauseCode::AwaitableExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::ForLoopIterator(__binding_0) => {
                        ObligationCauseCode::ForLoopIterator(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::QuestionMark => {
                        ObligationCauseCode::QuestionMark
                    }
                    ObligationCauseCode::WellFormed(__binding_0) => {
                        ObligationCauseCode::WellFormed(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::MatchImpl(__binding_0, __binding_1) =>
                        {
                        ObligationCauseCode::MatchImpl(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                    ObligationCauseCode::UnOp { hir_id: __binding_0 } => {
                        ObligationCauseCode::UnOp {
                            hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                        }
                    }
                    ObligationCauseCode::BinOp {
                        lhs_hir_id: __binding_0,
                        rhs_hir_id: __binding_1,
                        rhs_span: __binding_2,
                        rhs_is_lit: __binding_3,
                        output_ty: __binding_4 } => {
                        ObligationCauseCode::BinOp {
                            lhs_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            rhs_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            rhs_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                            rhs_is_lit: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
                                __folder),
                            output_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_4,
                                __folder),
                        }
                    }
                    ObligationCauseCode::AscribeUserTypeProvePredicate(__binding_0,
                        __binding_1) => {
                        ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                    ObligationCauseCode::RustCall => {
                        ObligationCauseCode::RustCall
                    }
                    ObligationCauseCode::DynCompatible(__binding_0) => {
                        ObligationCauseCode::DynCompatible(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::AlwaysApplicableImpl => {
                        ObligationCauseCode::AlwaysApplicableImpl
                    }
                    ObligationCauseCode::ConstParam(__binding_0) => {
                        ObligationCauseCode::ConstParam(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::ConstItemTy(__binding_0) => {
                        ObligationCauseCode::ConstItemTy(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::TypeAlias(__binding_0, __binding_1,
                        __binding_2) => {
                        ObligationCauseCode::TypeAlias(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder))
                    }
                    ObligationCauseCode::UnsizedNonPlaceExpr(__binding_0) => {
                        ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ObligationCauseCode::CompareEii {
                        external_impl: __binding_0, declaration: __binding_1 } => {
                        ObligationCauseCode::CompareEii {
                            external_impl: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            declaration: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
183pub enum ObligationCauseCode<'tcx> {
184    /// Not well classified or should be obvious from the span.
185    Misc,
186
187    /// A slice or array is WF only if `T: Sized`.
188    SliceOrArrayElem,
189
190    /// An array `[T; N]` can only be indexed (and is only well-formed if) `N` has type usize.
191    ArrayLen(Ty<'tcx>),
192
193    /// A tuple is WF only if its middle elements are `Sized`.
194    TupleElem,
195
196    /// Represents a clause that comes from a specific item.
197    /// The span corresponds to the clause.
198    WhereClause(DefId, Span),
199
200    /// Represents a bound for an opaque we are checking the well-formedness of.
201    /// The def-id corresponds to a specific definition site that we found the
202    /// hidden type from, if any.
203    OpaqueTypeBound(Span, Option<LocalDefId>),
204
205    /// Like `WhereClause`, but also identifies the expression
206    /// which requires the `where` clause to be proven, and also
207    /// identifies the index of the clause in the `clauses_of`
208    /// list of the item.
209    WhereClauseInExpr(DefId, Span, HirId, usize),
210
211    /// Like `WhereClauseinExpr`, but indexes into the `const_conditions`
212    /// rather than the `clauses_of`.
213    HostEffectInExpr(DefId, Span, HirId, usize),
214
215    /// A type like `&'a T` is WF only if `T: 'a`.
216    ReferenceOutlivesReferent(Ty<'tcx>),
217
218    /// A type like `Box<Foo<'a> + 'b>` is WF only if `'b: 'a`.
219    ObjectTypeBound(Ty<'tcx>, ty::Region<'tcx>),
220
221    /// Obligation incurred due to a coercion.
222    Coercion {
223        source: Ty<'tcx>,
224        target: Ty<'tcx>,
225    },
226
227    /// Various cases where expressions must be `Sized` / `Copy` / etc.
228    /// `L = X` implies that `L` is `Sized`.
229    AssignmentLhsSized,
230    /// `(x1, .., xn)` must be `Sized`.
231    TupleInitializerSized,
232    /// `S { ... }` must be `Sized`.
233    StructInitializerSized,
234    /// Type of each variable must be `Sized`.
235    VariableType(HirId),
236    /// Argument type must be `Sized`.
237    SizedArgumentType(Option<HirId>),
238    /// Return type must be `Sized`.
239    SizedReturnType,
240    /// Return type of a call expression must be `Sized`.
241    SizedCallReturnType(HirId),
242    /// Yield type must be `Sized`.
243    SizedYieldType,
244    /// Inline asm operand type must be `Sized`.
245    InlineAsmSized,
246    /// Captured closure type must be `Sized`.
247    SizedClosureCapture(LocalDefId),
248    /// Types live across coroutine yields must be `Sized`.
249    SizedCoroutineInterior(LocalDefId),
250    /// `[expr; N]` requires `type_of(expr): Copy`.
251    RepeatElementCopy {
252        /// If element is a `const fn` or const ctor we display a help message suggesting
253        /// to move it to a new `const` item while saying that `T` doesn't implement `Copy`.
254        is_constable: IsConstable,
255
256        /// Span of the repeat element.
257        ///
258        /// This is used to suggest wrapping it in a `const { ... }` block.
259        elt_span: Span,
260    },
261
262    /// Types of fields (other than the last, except for packed structs) in a struct must be sized.
263    FieldSized {
264        adt_kind: AdtKind,
265        span: Span,
266        last: bool,
267    },
268
269    /// Constant expressions must be sized.
270    SizedConstOrStatic,
271
272    /// `static` items must have `Sync` type.
273    SharedStatic,
274
275    /// Derived obligation (i.e. theoretical `where` clause) on a built-in
276    /// implementation like `Copy` or `Sized`.
277    BuiltinDerived(DerivedCause<'tcx>),
278
279    /// Derived obligation (i.e. `where` clause) on an user-provided impl
280    /// or a trait alias.
281    ImplDerived(Box<ImplDerivedCause<'tcx>>),
282
283    /// Derived obligation for WF goals.
284    WellFormedDerived(DerivedCause<'tcx>),
285
286    /// Derived obligation (i.e. `where` clause) on an user-provided impl
287    /// or a trait alias.
288    ImplDerivedHost(Box<ImplDerivedHostCause<'tcx>>),
289
290    /// Derived obligation (i.e. `where` clause) on an user-provided impl
291    /// or a trait alias.
292    BuiltinDerivedHost(DerivedHostCause<'tcx>),
293
294    /// Derived obligation refined to point at a specific argument in
295    /// a call or method expression.
296    FunctionArg {
297        /// The node of the relevant argument in the function call.
298        arg_hir_id: HirId,
299        /// The node of the function call.
300        call_hir_id: HirId,
301        /// The obligation introduced by this argument.
302        parent_code: ObligationCauseCodeHandle<'tcx>,
303    },
304
305    /// Error derived when checking an impl item is compatible with
306    /// its corresponding trait item's definition
307    CompareImplItem {
308        impl_item_def_id: LocalDefId,
309        trait_item_def_id: DefId,
310        kind: ty::AssocKind,
311    },
312
313    /// Checking that the bounds of a trait's associated type hold for a given impl
314    CheckAssociatedTypeBounds {
315        impl_item_def_id: LocalDefId,
316        trait_item_def_id: DefId,
317    },
318
319    /// Checking that this expression can be assigned to its target.
320    ExprAssignable,
321
322    /// Computing common supertype in the arms of a match expression
323    MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>),
324
325    /// Type error arising from type checking a pattern against an expected type.
326    Pattern {
327        /// The span of the scrutinee or type expression which caused the `root_ty` type.
328        span: Option<Span>,
329        /// The root expected type induced by a scrutinee or type expression.
330        root_ty: Ty<'tcx>,
331        /// Information about the `Span`, if it came from an expression, otherwise `None`.
332        origin_expr: Option<PatternOriginExpr>,
333    },
334
335    /// Computing common supertype in an if expression
336    IfExpression {
337        expr_id: HirId,
338        // Is the expectation of this match expression an RPIT?
339        tail_defines_return_position_impl_trait: Option<LocalDefId>,
340    },
341
342    /// Computing common supertype of an if expression with no else counter-part
343    IfExpressionWithNoElse,
344
345    /// `main` has wrong type
346    MainFunctionType,
347
348    /// language function has wrong type
349    LangFunctionType(Symbol),
350
351    /// Intrinsic has wrong type
352    IntrinsicType,
353
354    /// A let else block does not diverge
355    LetElse,
356
357    /// Method receiver
358    MethodReceiver,
359
360    /// `return` with no expression
361    ReturnNoExpression,
362
363    /// `return` with an expression
364    ReturnValue(HirId),
365
366    /// Opaque return type of this function
367    OpaqueReturnType(Option<(Ty<'tcx>, HirId)>),
368
369    /// Block implicit return
370    BlockTailExpression(HirId, hir::MatchSource),
371
372    /// #[feature(trivial_bounds)] is not enabled
373    TrivialBound,
374
375    AwaitableExpr(HirId),
376
377    ForLoopIterator(HirId),
378
379    QuestionMark,
380
381    /// Well-formed checking. If a `WellFormedLoc` is provided,
382    /// then it will be used to perform HIR-based wf checking
383    /// after an error occurs, in order to generate a more precise error span.
384    /// This is purely for diagnostic purposes - it is always
385    /// correct to use `Misc` instead, or to specify
386    /// `WellFormed(None)`.
387    WellFormed(WellFormedLoc),
388
389    /// From `match_impl`. The cause for us having to match an impl, and the DefId we are matching
390    /// against.
391    MatchImpl(ObligationCause<'tcx>, DefId),
392
393    UnOp {
394        hir_id: HirId,
395    },
396
397    BinOp {
398        lhs_hir_id: HirId,
399        rhs_hir_id: HirId,
400        rhs_span: Span,
401        rhs_is_lit: bool,
402        output_ty: Option<Ty<'tcx>>,
403    },
404
405    AscribeUserTypeProvePredicate(Span, DefId),
406
407    RustCall,
408
409    DynCompatible(Span),
410
411    /// Obligations to prove that a `Drop` or negative auto trait impl is not stronger than
412    /// the ADT it's being implemented for.
413    AlwaysApplicableImpl,
414
415    /// Requirement for a `const N: Ty` to implement `Ty: ConstParamTy`
416    ConstParam(Ty<'tcx>),
417
418    /// Requirement for the type of a const item used in the type system to implement
419    /// `ConstParamTy`.
420    ConstItemTy(Ty<'tcx>),
421
422    /// Obligations emitted during the normalization of a free type alias.
423    TypeAlias(ObligationCauseCodeHandle<'tcx>, Span, DefId),
424
425    /// Only reachable if the `unsized_fn_params` feature is used. Unsized function arguments must
426    /// be place expressions because we can't store them in MIR locals as temporaries.
427    UnsizedNonPlaceExpr(Span),
428
429    /// Error derived when checking an impl item is compatible with
430    /// its corresponding trait item's definition
431    CompareEii {
432        external_impl: LocalDefId,
433        declaration: DefId,
434    },
435}
436
437/// Whether a value can be extracted into a const.
438/// Used for diagnostics around array repeat expressions.
439#[derive(#[automatically_derived]impl ::core::marker::Copy for IsConstable { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for IsConstable {
}
#[automatically_derived]impl ::core::clone::Clone for IsConstable {
    #[inline]
    fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for IsConstable {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                IsConstable::No => "No",
                IsConstable::Fn => "Fn",
                IsConstable::Ctor => "Ctor",
            })
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    IsConstable {
}
#[automatically_derived]impl ::core::cmp::PartialEq for IsConstable {
    #[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 IsConstable { }Eq, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for IsConstable
            {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    IsConstable::No => 0u8.stable_hash(__hcx, __hasher),
                    IsConstable::Fn => 1u8.stable_hash(__hcx, __hasher),
                    IsConstable::Ctor => 2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    IsConstable::No => {}
                    IsConstable::Fn => {}
                    IsConstable::Ctor => {}
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for IsConstable {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        IsConstable::No => { 0usize }
                        IsConstable::Fn => { 1usize }
                        IsConstable::Ctor => { 2usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for IsConstable {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { IsConstable::No }
                    1usize => { IsConstable::Fn }
                    2usize => { IsConstable::Ctor }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `IsConstable`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable)]
440pub enum IsConstable {
441    No,
442    /// Call to a const fn
443    Fn,
444    /// Use of a const ctor
445    Ctor,
446}
447
448/// The 'location' at which we try to perform HIR-based wf checking.
449/// This information is used to obtain an `hir::Ty`, which
450/// we can walk in order to obtain precise spans for any
451/// 'nested' types (e.g. `Foo` in `Option<Foo>`).
452#[derive(#[automatically_derived]impl ::core::marker::Copy for WellFormedLoc { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for WellFormedLoc {
}
#[automatically_derived]impl ::core::clone::Clone for WellFormedLoc {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<LocalDefId>;
        let _: ::core::clone::AssertParamIsClone<usize>;
        let _: ::core::clone::AssertParamIsClone<HirId>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for WellFormedLoc {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Ty(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Ty",
                    &__self_0),
            Self::Param { function: __self_0, param_idx: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Param function param_idx", __self_0, &__self_1),
            Self::HirId(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "HirId",
                    &__self_0),
            Self::None => ::core::fmt::Formatter::write_str(f, "None"),
        }
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    WellFormedLoc {
}
#[automatically_derived]impl ::core::cmp::PartialEq for WellFormedLoc {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::Ty(__self_0), Self::Ty(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Param { function: __self_0, param_idx: __self_1 },
                    Self::Param { function: __arg1_0, param_idx: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (Self::HirId(__self_0), Self::HirId(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for WellFormedLoc {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
        let _: ::core::cmp::AssertParamIsEq<usize>;
        let _: ::core::cmp::AssertParamIsEq<HirId>;
    }
}Eq, #[automatically_derived]impl ::core::hash::Hash for WellFormedLoc {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::Ty(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            Self::Param { function: __self_0, param_idx: __self_1 } => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            Self::HirId(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            WellFormedLoc {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    WellFormedLoc::Ty(ref __binding_0) =>
                        0u8.stable_hash(__hcx, __hasher),
                    WellFormedLoc::Param {
                        function: ref __binding_0, param_idx: ref __binding_1 } =>
                        1u8.stable_hash(__hcx, __hasher),
                    WellFormedLoc::HirId(ref __binding_0) =>
                        2u8.stable_hash(__hcx, __hasher),
                    WellFormedLoc::None => 3u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    WellFormedLoc::Ty(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    WellFormedLoc::Param {
                        function: ref __binding_0, param_idx: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                    WellFormedLoc::HirId(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    WellFormedLoc::None => {}
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for WellFormedLoc {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        WellFormedLoc::Ty(ref __binding_0) => { 0usize }
                        WellFormedLoc::Param {
                            function: ref __binding_0, param_idx: ref __binding_1 } => {
                            1usize
                        }
                        WellFormedLoc::HirId(ref __binding_0) => { 2usize }
                        WellFormedLoc::None => { 3usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    WellFormedLoc::Ty(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    WellFormedLoc::Param {
                        function: ref __binding_0, param_idx: ref __binding_1 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                    WellFormedLoc::HirId(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    WellFormedLoc::None => {}
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for WellFormedLoc {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => {
                        WellFormedLoc::Ty(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    1usize => {
                        WellFormedLoc::Param {
                            function: ::rustc_serialize::Decodable::decode(__decoder),
                            param_idx: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    2usize => {
                        WellFormedLoc::HirId(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    3usize => { WellFormedLoc::None }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `WellFormedLoc`, expected 0..4, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
453#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for WellFormedLoc {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    WellFormedLoc::Ty(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    WellFormedLoc::Param {
                        function: ref __binding_0, param_idx: ref __binding_1 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    WellFormedLoc::HirId(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    WellFormedLoc::None => {}
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for WellFormedLoc {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        WellFormedLoc::Ty(__binding_0) => {
                            WellFormedLoc::Ty(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        WellFormedLoc::Param {
                            function: __binding_0, param_idx: __binding_1 } => {
                            WellFormedLoc::Param {
                                function: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                param_idx: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                        WellFormedLoc::HirId(__binding_0) => {
                            WellFormedLoc::HirId(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        WellFormedLoc::None => { WellFormedLoc::None }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    WellFormedLoc::Ty(__binding_0) => {
                        WellFormedLoc::Ty(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    WellFormedLoc::Param {
                        function: __binding_0, param_idx: __binding_1 } => {
                        WellFormedLoc::Param {
                            function: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            param_idx: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                    WellFormedLoc::HirId(__binding_0) => {
                        WellFormedLoc::HirId(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    WellFormedLoc::None => { WellFormedLoc::None }
                }
            }
        }
    };TypeFoldable)]
454pub enum WellFormedLoc {
455    /// Use the type of the provided definition.
456    Ty(LocalDefId),
457    /// Use the type of the parameter of the provided function.
458    /// We cannot use `hir::Param`, since the function may
459    /// not have a body (e.g. a trait method definition)
460    Param {
461        /// The function to lookup the parameter in
462        function: LocalDefId,
463        /// The index of the parameter to use.
464        /// Parameters are indexed from 0, with the return type
465        /// being the last 'parameter'
466        param_idx: usize,
467    },
468    HirId(HirId),
469    None,
470}
471
472impl<'tcx> ObligationCauseCode<'tcx> {
473    /// Returns the base obligation, ignoring derived obligations.
474    pub fn peel_derives(&self) -> &Self {
475        let mut base_cause = self;
476        while let Some(parent_code) = base_cause.parent() {
477            base_cause = parent_code;
478        }
479        base_cause
480    }
481
482    pub fn parent(&self) -> Option<&Self> {
483        match self {
484            ObligationCauseCode::FunctionArg { parent_code, .. } => Some(parent_code),
485            ObligationCauseCode::BuiltinDerived(derived)
486            | ObligationCauseCode::WellFormedDerived(derived)
487            | ObligationCauseCode::ImplDerived(ImplDerivedCause { derived, .. }) => {
488                Some(&derived.parent_code)
489            }
490            ObligationCauseCode::BuiltinDerivedHost(derived)
491            | ObligationCauseCode::ImplDerivedHost(ImplDerivedHostCause { derived, .. }) => {
492                Some(&derived.parent_code)
493            }
494            _ => None,
495        }
496    }
497
498    /// Returns the base obligation and the base trait predicate, if any, ignoring
499    /// derived obligations.
500    pub fn peel_derives_with_predicate(&self) -> (&Self, Option<ty::PolyTraitClause<'tcx>>) {
501        let mut base_cause = self;
502        let mut base_trait_pred = None;
503        while let Some((parent_code, parent_pred)) = base_cause.parent_with_predicate() {
504            base_cause = parent_code;
505            if let Some(parent_pred) = parent_pred {
506                base_trait_pred = Some(parent_pred);
507            }
508        }
509
510        (base_cause, base_trait_pred)
511    }
512
513    pub fn parent_with_predicate(&self) -> Option<(&Self, Option<ty::PolyTraitClause<'tcx>>)> {
514        match self {
515            ObligationCauseCode::FunctionArg { parent_code, .. } => Some((parent_code, None)),
516            ObligationCauseCode::BuiltinDerived(derived)
517            | ObligationCauseCode::WellFormedDerived(derived)
518            | ObligationCauseCode::ImplDerived(ImplDerivedCause { derived, .. }) => {
519                Some((&derived.parent_code, Some(derived.parent_trait_pred)))
520            }
521            _ => None,
522        }
523    }
524
525    pub fn peel_match_impls(&self) -> &Self {
526        match self {
527            ObligationCauseCode::MatchImpl(cause, _) => cause.code(),
528            _ => self,
529        }
530    }
531}
532
533// `ObligationCauseCode` is used a lot. Make sure it doesn't unintentionally get bigger.
534#[cfg(target_pointer_width = "64")]
535const _: [(); 48] = [(); ::std::mem::size_of::<ObligationCauseCode<'_>>()];rustc_data_structures::static_assert_size!(ObligationCauseCode<'_>, 48);
536
537#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    MatchExpressionArmCause<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        MatchExpressionArmCause {
            arm_block_id: ::core::clone::Clone::clone(&self.arm_block_id),
            arm_ty: ::core::clone::Clone::clone(&self.arm_ty),
            arm_span: ::core::clone::Clone::clone(&self.arm_span),
            prior_arm_block_id: ::core::clone::Clone::clone(&self.prior_arm_block_id),
            prior_arm_ty: ::core::clone::Clone::clone(&self.prior_arm_ty),
            prior_arm_span: ::core::clone::Clone::clone(&self.prior_arm_span),
            scrut_span: ::core::clone::Clone::clone(&self.scrut_span),
            source: ::core::clone::Clone::clone(&self.source),
            expr_span: ::core::clone::Clone::clone(&self.expr_span),
            prior_non_diverging_arms: ::core::clone::Clone::clone(&self.prior_non_diverging_arms),
            tail_defines_return_position_impl_trait: ::core::clone::Clone::clone(&self.tail_defines_return_position_impl_trait),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    MatchExpressionArmCause<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            "MatchExpressionArmCause arm_block_id arm_ty arm_span prior_arm_block_id prior_arm_ty prior_arm_span scrut_span source expr_span prior_non_diverging_arms tail_defines_return_position_impl_trait";
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.arm_block_id, &self.arm_ty, &self.arm_span,
                        &self.prior_arm_block_id, &self.prior_arm_ty,
                        &self.prior_arm_span, &self.scrut_span, &self.source,
                        &self.expr_span, &self.prior_non_diverging_arms,
                        &&self.tail_defines_return_position_impl_trait];
        ::core::fmt::Formatter::debug_struct_fields_finish(f, names, values)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    MatchExpressionArmCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    MatchExpressionArmCause<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.arm_block_id == other.arm_block_id && self.arm_ty == other.arm_ty
                                            && self.arm_span == other.arm_span &&
                                        self.prior_arm_block_id == other.prior_arm_block_id &&
                                    self.prior_arm_ty == other.prior_arm_ty &&
                                self.prior_arm_span == other.prior_arm_span &&
                            self.scrut_span == other.scrut_span &&
                        self.source == other.source &&
                    self.expr_span == other.expr_span &&
                self.prior_non_diverging_arms ==
                    other.prior_non_diverging_arms &&
            self.tail_defines_return_position_impl_trait ==
                other.tail_defines_return_position_impl_trait
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
    MatchExpressionArmCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<HirId>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<Option<HirId>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<hir::MatchSource>;
        let _: ::core::cmp::AssertParamIsEq<Vec<Span>>;
        let _: ::core::cmp::AssertParamIsEq<Option<LocalDefId>>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            MatchExpressionArmCause<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    MatchExpressionArmCause {
                        arm_block_id: ref __binding_0,
                        arm_ty: ref __binding_1,
                        arm_span: ref __binding_2,
                        prior_arm_block_id: ref __binding_3,
                        prior_arm_ty: ref __binding_4,
                        prior_arm_span: ref __binding_5,
                        scrut_span: ref __binding_6,
                        source: ref __binding_7,
                        expr_span: ref __binding_8,
                        prior_non_diverging_arms: ref __binding_9,
                        tail_defines_return_position_impl_trait: ref __binding_10 }
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                        { __binding_4.stable_hash(__hcx, __hasher); }
                        { __binding_5.stable_hash(__hcx, __hasher); }
                        { __binding_6.stable_hash(__hcx, __hasher); }
                        { __binding_7.stable_hash(__hcx, __hasher); }
                        { __binding_8.stable_hash(__hcx, __hasher); }
                        { __binding_9.stable_hash(__hcx, __hasher); }
                        { __binding_10.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for
            MatchExpressionArmCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let MatchExpressionArmCause {
                        arm_block_id: ref __binding_0,
                        arm_ty: ref __binding_1,
                        arm_span: ref __binding_2,
                        prior_arm_block_id: ref __binding_3,
                        prior_arm_ty: ref __binding_4,
                        prior_arm_span: ref __binding_5,
                        scrut_span: ref __binding_6,
                        source: ref __binding_7,
                        expr_span: ref __binding_8,
                        prior_non_diverging_arms: ref __binding_9,
                        tail_defines_return_position_impl_trait: ref __binding_10
                        } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_4,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_5,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_6,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_7,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_8,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_9,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_10,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for
            MatchExpressionArmCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                MatchExpressionArmCause {
                    arm_block_id: ::rustc_serialize::Decodable::decode(__decoder),
                    arm_ty: ::rustc_serialize::Decodable::decode(__decoder),
                    arm_span: ::rustc_serialize::Decodable::decode(__decoder),
                    prior_arm_block_id: ::rustc_serialize::Decodable::decode(__decoder),
                    prior_arm_ty: ::rustc_serialize::Decodable::decode(__decoder),
                    prior_arm_span: ::rustc_serialize::Decodable::decode(__decoder),
                    scrut_span: ::rustc_serialize::Decodable::decode(__decoder),
                    source: ::rustc_serialize::Decodable::decode(__decoder),
                    expr_span: ::rustc_serialize::Decodable::decode(__decoder),
                    prior_non_diverging_arms: ::rustc_serialize::Decodable::decode(__decoder),
                    tail_defines_return_position_impl_trait: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
538#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for MatchExpressionArmCause<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    MatchExpressionArmCause {
                        arm_block_id: ref __binding_0,
                        arm_ty: ref __binding_1,
                        arm_span: ref __binding_2,
                        prior_arm_block_id: ref __binding_3,
                        prior_arm_ty: ref __binding_4,
                        prior_arm_span: ref __binding_5,
                        scrut_span: ref __binding_6,
                        source: ref __binding_7,
                        expr_span: ref __binding_8,
                        prior_non_diverging_arms: ref __binding_9,
                        tail_defines_return_position_impl_trait: ref __binding_10 }
                        => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_4,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_5,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_6,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_7,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_8,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_9,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_10,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for MatchExpressionArmCause<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        MatchExpressionArmCause {
                            arm_block_id: __binding_0,
                            arm_ty: __binding_1,
                            arm_span: __binding_2,
                            prior_arm_block_id: __binding_3,
                            prior_arm_ty: __binding_4,
                            prior_arm_span: __binding_5,
                            scrut_span: __binding_6,
                            source: __binding_7,
                            expr_span: __binding_8,
                            prior_non_diverging_arms: __binding_9,
                            tail_defines_return_position_impl_trait: __binding_10 } => {
                            MatchExpressionArmCause {
                                arm_block_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                arm_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                arm_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                                prior_arm_block_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
                                        __folder)?,
                                prior_arm_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_4,
                                        __folder)?,
                                prior_arm_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_5,
                                        __folder)?,
                                scrut_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_6,
                                        __folder)?,
                                source: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_7,
                                        __folder)?,
                                expr_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_8,
                                        __folder)?,
                                prior_non_diverging_arms: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_9,
                                        __folder)?,
                                tail_defines_return_position_impl_trait: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_10,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    MatchExpressionArmCause {
                        arm_block_id: __binding_0,
                        arm_ty: __binding_1,
                        arm_span: __binding_2,
                        prior_arm_block_id: __binding_3,
                        prior_arm_ty: __binding_4,
                        prior_arm_span: __binding_5,
                        scrut_span: __binding_6,
                        source: __binding_7,
                        expr_span: __binding_8,
                        prior_non_diverging_arms: __binding_9,
                        tail_defines_return_position_impl_trait: __binding_10 } => {
                        MatchExpressionArmCause {
                            arm_block_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            arm_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            arm_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                            prior_arm_block_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
                                __folder),
                            prior_arm_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_4,
                                __folder),
                            prior_arm_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_5,
                                __folder),
                            scrut_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_6,
                                __folder),
                            source: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_7,
                                __folder),
                            expr_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_8,
                                __folder),
                            prior_non_diverging_arms: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_9,
                                __folder),
                            tail_defines_return_position_impl_trait: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_10,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
539pub struct MatchExpressionArmCause<'tcx> {
540    pub arm_block_id: Option<HirId>,
541    pub arm_ty: Ty<'tcx>,
542    pub arm_span: Span,
543    pub prior_arm_block_id: Option<HirId>,
544    pub prior_arm_ty: Ty<'tcx>,
545    pub prior_arm_span: Span,
546    /// Span of the scrutinee of the match (the matched value).
547    pub scrut_span: Span,
548    /// Source of the match, i.e. `match` or a desugaring.
549    pub source: hir::MatchSource,
550    /// Span of the *whole* match expr.
551    pub expr_span: Span,
552    /// Spans of the previous arms except for those that diverge (i.e. evaluate to `!`).
553    ///
554    /// These are used for pointing out errors that may affect several arms.
555    pub prior_non_diverging_arms: Vec<Span>,
556    /// Is the expectation of this match expression an RPIT?
557    pub tail_defines_return_position_impl_trait: Option<LocalDefId>,
558}
559
560/// Information about the origin expression of a pattern, relevant to diagnostics.
561/// Fields here refer to the scrutinee of a pattern.
562/// If the scrutinee isn't given in the diagnostic, then this won't exist.
563#[derive(#[automatically_derived]impl ::core::marker::Copy for PatternOriginExpr { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for PatternOriginExpr {
}
#[automatically_derived]impl ::core::clone::Clone for PatternOriginExpr {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<Span>;
        let _: ::core::clone::AssertParamIsClone<usize>;
        let _: ::core::clone::AssertParamIsClone<bool>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for PatternOriginExpr {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "PatternOriginExpr peeled_span peeled_count peeled_prefix_suggestion_parentheses",
            &self.peeled_span, &self.peeled_count,
            &&self.peeled_prefix_suggestion_parentheses)
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    PatternOriginExpr {
}
#[automatically_derived]impl ::core::cmp::PartialEq for PatternOriginExpr {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.peeled_prefix_suggestion_parentheses ==
                    other.peeled_prefix_suggestion_parentheses &&
                self.peeled_span == other.peeled_span &&
            self.peeled_count == other.peeled_count
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for PatternOriginExpr {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<usize>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
    }
}Eq)]
564#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for PatternOriginExpr {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        PatternOriginExpr {
                            peeled_span: __binding_0,
                            peeled_count: __binding_1,
                            peeled_prefix_suggestion_parentheses: __binding_2 } => {
                            PatternOriginExpr {
                                peeled_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                peeled_count: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                peeled_prefix_suggestion_parentheses: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    PatternOriginExpr {
                        peeled_span: __binding_0,
                        peeled_count: __binding_1,
                        peeled_prefix_suggestion_parentheses: __binding_2 } => {
                        PatternOriginExpr {
                            peeled_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            peeled_count: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            peeled_prefix_suggestion_parentheses: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for PatternOriginExpr {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    PatternOriginExpr {
                        peeled_span: ref __binding_0,
                        peeled_count: ref __binding_1,
                        peeled_prefix_suggestion_parentheses: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            PatternOriginExpr {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    PatternOriginExpr {
                        peeled_span: ref __binding_0,
                        peeled_count: ref __binding_1,
                        peeled_prefix_suggestion_parentheses: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for PatternOriginExpr {
            fn encode(&self, __encoder: &mut __E) {
                let PatternOriginExpr {
                        peeled_span: ref __binding_0,
                        peeled_count: ref __binding_1,
                        peeled_prefix_suggestion_parentheses: ref __binding_2 } =
                    *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for PatternOriginExpr {
            fn decode(__decoder: &mut __D) -> Self {
                PatternOriginExpr {
                    peeled_span: ::rustc_serialize::Decodable::decode(__decoder),
                    peeled_count: ::rustc_serialize::Decodable::decode(__decoder),
                    peeled_prefix_suggestion_parentheses: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
565pub struct PatternOriginExpr {
566    /// A span representing the scrutinee expression, with all leading references
567    /// peeled from the expression.
568    /// Only references in the expression are peeled - if the expression refers to a variable
569    /// whose type is a reference, then that reference is kept because it wasn't created
570    /// in the expression.
571    pub peeled_span: Span,
572    /// The number of references that were peeled to produce `peeled_span`.
573    pub peeled_count: usize,
574    /// Does the peeled expression need to be wrapped in parentheses for
575    /// a prefix suggestion (i.e., dereference) to be valid.
576    pub peeled_prefix_suggestion_parentheses: bool,
577}
578
579#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for DerivedCause<'tcx>
    {
    #[inline]
    fn clone(&self) -> Self {
        DerivedCause {
            parent_trait_pred: ::core::clone::Clone::clone(&self.parent_trait_pred),
            parent_code: ::core::clone::Clone::clone(&self.parent_code),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for DerivedCause<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "DerivedCause parent_trait_pred parent_code",
            &self.parent_trait_pred, &&self.parent_code)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    DerivedCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    DerivedCause<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.parent_trait_pred == other.parent_trait_pred &&
            self.parent_code == other.parent_code
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for DerivedCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<ty::PolyTraitClause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            DerivedCause<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    DerivedCause {
                        parent_trait_pred: ref __binding_0,
                        parent_code: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for DerivedCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let DerivedCause {
                        parent_trait_pred: ref __binding_0,
                        parent_code: ref __binding_1 } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for DerivedCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                DerivedCause {
                    parent_trait_pred: ::rustc_serialize::Decodable::decode(__decoder),
                    parent_code: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
580#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for DerivedCause<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    DerivedCause {
                        parent_trait_pred: ref __binding_0,
                        parent_code: ref __binding_1 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for DerivedCause<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        DerivedCause {
                            parent_trait_pred: __binding_0, parent_code: __binding_1 }
                            => {
                            DerivedCause {
                                parent_trait_pred: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                parent_code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    DerivedCause {
                        parent_trait_pred: __binding_0, parent_code: __binding_1 }
                        => {
                        DerivedCause {
                            parent_trait_pred: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            parent_code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
581pub struct DerivedCause<'tcx> {
582    /// The trait predicate of the parent obligation that led to the
583    /// current obligation. Note that only trait obligations lead to
584    /// derived obligations, so we just store the trait predicate here
585    /// directly.
586    pub parent_trait_pred: ty::PolyTraitClause<'tcx>,
587
588    /// The parent trait had this cause.
589    pub parent_code: ObligationCauseCodeHandle<'tcx>,
590}
591
592#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    ImplDerivedCause<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        ImplDerivedCause {
            derived: ::core::clone::Clone::clone(&self.derived),
            impl_or_alias_def_id: ::core::clone::Clone::clone(&self.impl_or_alias_def_id),
            impl_def_clause_index: ::core::clone::Clone::clone(&self.impl_def_clause_index),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    ImplDerivedCause<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "ImplDerivedCause derived impl_or_alias_def_id impl_def_clause_index span",
            &self.derived, &self.impl_or_alias_def_id,
            &self.impl_def_clause_index, &&self.span)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    ImplDerivedCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    ImplDerivedCause<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.derived == other.derived &&
                    self.impl_or_alias_def_id == other.impl_or_alias_def_id &&
                self.impl_def_clause_index == other.impl_def_clause_index &&
            self.span == other.span
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for ImplDerivedCause<'tcx>
    {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<DerivedCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<Option<usize>>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ImplDerivedCause<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ImplDerivedCause {
                        derived: ref __binding_0,
                        impl_or_alias_def_id: ref __binding_1,
                        impl_def_clause_index: ref __binding_2,
                        span: ref __binding_3 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                        { __binding_3.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ImplDerivedCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let ImplDerivedCause {
                        derived: ref __binding_0,
                        impl_or_alias_def_id: ref __binding_1,
                        impl_def_clause_index: ref __binding_2,
                        span: ref __binding_3 } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for ImplDerivedCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                ImplDerivedCause {
                    derived: ::rustc_serialize::Decodable::decode(__decoder),
                    impl_or_alias_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                    impl_def_clause_index: ::rustc_serialize::Decodable::decode(__decoder),
                    span: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
593#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplDerivedCause<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ImplDerivedCause {
                        derived: ref __binding_0,
                        impl_or_alias_def_id: ref __binding_1,
                        impl_def_clause_index: ref __binding_2,
                        span: ref __binding_3 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplDerivedCause<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ImplDerivedCause {
                            derived: __binding_0,
                            impl_or_alias_def_id: __binding_1,
                            impl_def_clause_index: __binding_2,
                            span: __binding_3 } => {
                            ImplDerivedCause {
                                derived: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                impl_or_alias_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                impl_def_clause_index: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                                span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ImplDerivedCause {
                        derived: __binding_0,
                        impl_or_alias_def_id: __binding_1,
                        impl_def_clause_index: __binding_2,
                        span: __binding_3 } => {
                        ImplDerivedCause {
                            derived: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            impl_or_alias_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            impl_def_clause_index: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
594pub struct ImplDerivedCause<'tcx> {
595    pub derived: DerivedCause<'tcx>,
596    /// The `DefId` of the `impl` that gave rise to the `derived` obligation.
597    /// If the `derived` obligation arose from a trait alias, which conceptually has a synthetic
598    /// impl, then this will be the `DefId` of that trait alias. Care should therefore be taken to
599    /// handle that exceptional case where appropriate.
600    pub impl_or_alias_def_id: DefId,
601    /// The index of the derived clause in the parent impl's clauses.
602    pub impl_def_clause_index: Option<usize>,
603    pub span: Span,
604}
605
606#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    DerivedHostCause<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        DerivedHostCause {
            parent_host_clause: ::core::clone::Clone::clone(&self.parent_host_clause),
            parent_code: ::core::clone::Clone::clone(&self.parent_code),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    DerivedHostCause<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "DerivedHostCause parent_host_clause parent_code",
            &self.parent_host_clause, &&self.parent_code)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    DerivedHostCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    DerivedHostCause<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.parent_host_clause == other.parent_host_clause &&
            self.parent_code == other.parent_code
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for DerivedHostCause<'tcx>
    {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<ty::Binder<'tcx,
                ty::HostEffectClause<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            DerivedHostCause<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    DerivedHostCause {
                        parent_host_clause: ref __binding_0,
                        parent_code: ref __binding_1 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for DerivedHostCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let DerivedHostCause {
                        parent_host_clause: ref __binding_0,
                        parent_code: ref __binding_1 } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for DerivedHostCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                DerivedHostCause {
                    parent_host_clause: ::rustc_serialize::Decodable::decode(__decoder),
                    parent_code: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
607#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for DerivedHostCause<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    DerivedHostCause {
                        parent_host_clause: ref __binding_0,
                        parent_code: ref __binding_1 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for DerivedHostCause<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        DerivedHostCause {
                            parent_host_clause: __binding_0, parent_code: __binding_1 }
                            => {
                            DerivedHostCause {
                                parent_host_clause: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                parent_code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    DerivedHostCause {
                        parent_host_clause: __binding_0, parent_code: __binding_1 }
                        => {
                        DerivedHostCause {
                            parent_host_clause: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            parent_code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
608pub struct DerivedHostCause<'tcx> {
609    /// The trait clause of the parent obligation that led to the
610    /// current obligation. Note that only trait obligations lead to
611    /// derived obligations, so we just store the trait clause here
612    /// directly.
613    pub parent_host_clause: ty::Binder<'tcx, ty::HostEffectClause<'tcx>>,
614
615    /// The parent trait had this cause.
616    pub parent_code: ObligationCauseCodeHandle<'tcx>,
617}
618
619#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    ImplDerivedHostCause<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        ImplDerivedHostCause {
            derived: ::core::clone::Clone::clone(&self.derived),
            impl_def_id: ::core::clone::Clone::clone(&self.impl_def_id),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    ImplDerivedHostCause<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "ImplDerivedHostCause derived impl_def_id span", &self.derived,
            &self.impl_def_id, &&self.span)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    ImplDerivedHostCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    ImplDerivedHostCause<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.derived == other.derived && self.impl_def_id == other.impl_def_id
            && self.span == other.span
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
    ImplDerivedHostCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<DerivedHostCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
    }
}Eq, const _: () =
    {
        impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
            ImplDerivedHostCause<'tcx> {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ImplDerivedHostCause {
                        derived: ref __binding_0,
                        impl_def_id: ref __binding_1,
                        span: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ImplDerivedHostCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                let ImplDerivedHostCause {
                        derived: ref __binding_0,
                        impl_def_id: ref __binding_1,
                        span: ref __binding_2 } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for ImplDerivedHostCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                ImplDerivedHostCause {
                    derived: ::rustc_serialize::Decodable::decode(__decoder),
                    impl_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                    span: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
620#[derive(const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplDerivedHostCause<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ImplDerivedHostCause {
                        derived: ref __binding_0,
                        impl_def_id: ref __binding_1,
                        span: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplDerivedHostCause<'tcx> {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ImplDerivedHostCause {
                            derived: __binding_0,
                            impl_def_id: __binding_1,
                            span: __binding_2 } => {
                            ImplDerivedHostCause {
                                derived: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                impl_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ImplDerivedHostCause {
                        derived: __binding_0,
                        impl_def_id: __binding_1,
                        span: __binding_2 } => {
                        ImplDerivedHostCause {
                            derived: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            impl_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
621pub struct ImplDerivedHostCause<'tcx> {
622    pub derived: DerivedHostCause<'tcx>,
623    /// The `DefId` of the `impl` that gave rise to the `derived` obligation.
624    pub impl_def_id: DefId,
625    pub span: Span,
626}
627
628#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    SelectionError<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::Unimplemented => SelectionError::Unimplemented,
            Self::SignatureMismatch(__self_0) =>
                SelectionError::SignatureMismatch(::core::clone::Clone::clone(__self_0)),
            Self::TraitDynIncompatible(__self_0) =>
                SelectionError::TraitDynIncompatible(::core::clone::Clone::clone(__self_0)),
            Self::NotConstEvaluatable(__self_0) =>
                SelectionError::NotConstEvaluatable(::core::clone::Clone::clone(__self_0)),
            Self::Overflow(__self_0) =>
                SelectionError::Overflow(::core::clone::Clone::clone(__self_0)),
            Self::ConstArgHasWrongType {
                ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 } =>
                SelectionError::ConstArgHasWrongType {
                    ct: ::core::clone::Clone::clone(__self_0),
                    ct_ty: ::core::clone::Clone::clone(__self_1),
                    expected_ty: ::core::clone::Clone::clone(__self_2),
                },
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for SelectionError<'tcx>
    {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Unimplemented =>
                ::core::fmt::Formatter::write_str(f, "Unimplemented"),
            Self::SignatureMismatch(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SignatureMismatch", &__self_0),
            Self::TraitDynIncompatible(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "TraitDynIncompatible", &__self_0),
            Self::NotConstEvaluatable(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "NotConstEvaluatable", &__self_0),
            Self::Overflow(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "Overflow", &__self_0),
            Self::ConstArgHasWrongType {
                ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "ConstArgHasWrongType ct ct_ty expected_ty", __self_0,
                    __self_1, &__self_2),
        }
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    SelectionError<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    SelectionError<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::SignatureMismatch(__self_0),
                    Self::SignatureMismatch(__arg1_0)) => __self_0 == __arg1_0,
                (Self::TraitDynIncompatible(__self_0),
                    Self::TraitDynIncompatible(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::NotConstEvaluatable(__self_0),
                    Self::NotConstEvaluatable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Overflow(__self_0), Self::Overflow(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::ConstArgHasWrongType {
                    ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 },
                    Self::ConstArgHasWrongType {
                    ct: __arg1_0, ct_ty: __arg1_1, expected_ty: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for SelectionError<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Box<SignatureMismatchData<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<NotConstEvaluatable>;
        let _: ::core::cmp::AssertParamIsEq<OverflowError>;
        let _: ::core::cmp::AssertParamIsEq<ty::Const<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for SelectionError<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    SelectionError::Unimplemented => {}
                    SelectionError::SignatureMismatch(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    SelectionError::TraitDynIncompatible(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    SelectionError::NotConstEvaluatable(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    SelectionError::Overflow(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    SelectionError::ConstArgHasWrongType {
                        ct: ref __binding_0,
                        ct_ty: ref __binding_1,
                        expected_ty: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
629pub enum SelectionError<'tcx> {
630    /// The trait is not implemented.
631    Unimplemented,
632    /// After a closure impl has selected, its "outputs" were evaluated
633    /// (which for closures includes the "input" type params) and they
634    /// didn't resolve. See `confirm_poly_trait_refs` for more.
635    SignatureMismatch(Box<SignatureMismatchData<'tcx>>),
636    /// The trait pointed by `DefId` is dyn-incompatible.
637    TraitDynIncompatible(DefId),
638    /// A given constant couldn't be evaluated.
639    NotConstEvaluatable(NotConstEvaluatable),
640    /// Exceeded the recursion depth during type projection.
641    Overflow(OverflowError),
642    /// Error for a `ConstArgHasType` goal
643    ConstArgHasWrongType { ct: ty::Const<'tcx>, ct_ty: Ty<'tcx>, expected_ty: Ty<'tcx> },
644}
645
646#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
    SignatureMismatchData<'tcx> {
    #[inline]
    fn clone(&self) -> Self {
        SignatureMismatchData {
            found_trait_ref: ::core::clone::Clone::clone(&self.found_trait_ref),
            expected_trait_ref: ::core::clone::Clone::clone(&self.expected_trait_ref),
            terr: ::core::clone::Clone::clone(&self.terr),
        }
    }
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
    SignatureMismatchData<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "SignatureMismatchData found_trait_ref expected_trait_ref terr",
            &self.found_trait_ref, &self.expected_trait_ref, &&self.terr)
    }
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
    SignatureMismatchData<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
    SignatureMismatchData<'tcx> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.found_trait_ref == other.found_trait_ref &&
                self.expected_trait_ref == other.expected_trait_ref &&
            self.terr == other.terr
    }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
    SignatureMismatchData<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<ty::TraitRef<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ty::TraitRef<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ty::error::TypeError<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for SignatureMismatchData<'tcx> {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    SignatureMismatchData {
                        found_trait_ref: ref __binding_0,
                        expected_trait_ref: ref __binding_1,
                        terr: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
647pub struct SignatureMismatchData<'tcx> {
648    pub found_trait_ref: ty::TraitRef<'tcx>,
649    pub expected_trait_ref: ty::TraitRef<'tcx>,
650    pub terr: ty::error::TypeError<'tcx>,
651}
652
653/// When performing resolution, it is typically the case that there
654/// can be one of three outcomes:
655///
656/// - `Ok(Some(r))`: success occurred with result `r`
657/// - `Ok(None)`: could not definitely determine anything, usually due
658///   to inconclusive type inference.
659/// - `Err(e)`: error `e` occurred
660pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
661
662/// Given the successful resolution of an obligation, the `ImplSource`
663/// indicates where the impl comes from.
664///
665/// For example, the obligation may be satisfied by a specific impl (case A),
666/// or it may be relative to some bound that is in scope (case B).
667///
668/// ```ignore (illustrative)
669/// impl<T:Clone> Clone<T> for Option<T> { ... } // Impl_1
670/// impl<T:Clone> Clone<T> for Box<T> { ... }    // Impl_2
671/// impl Clone for i32 { ... }                   // Impl_3
672///
673/// fn foo<T: Clone>(concrete: Option<Box<i32>>, param: T, mixed: Option<T>) {
674///     // Case A: ImplSource points at a specific impl. Only possible when
675///     // type is concretely known. If the impl itself has bounded
676///     // type parameters, ImplSource will carry resolutions for those as well:
677///     concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
678///
679///     // Case B: ImplSource must be provided by caller. This applies when
680///     // type is a type parameter.
681///     param.clone();    // ImplSource::Param
682///
683///     // Case C: A mix of cases A and B.
684///     mixed.clone();    // ImplSource(Impl_1, [ImplSource::Param])
685/// }
686/// ```
687///
688/// ### The type parameter `N`
689///
690/// See explanation on `ImplSourceUserDefinedData`.
691#[derive(#[automatically_derived]impl<'tcx, N: ::core::clone::Clone>
    ::core::clone::Clone for ImplSource<'tcx, N> {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::UserDefined(__self_0) =>
                ImplSource::UserDefined(::core::clone::Clone::clone(__self_0)),
            Self::Param(__self_0) =>
                ImplSource::Param(::core::clone::Clone::clone(__self_0)),
            Self::Builtin(__self_0, __self_1) =>
                ImplSource::Builtin(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
        }
    }
}Clone, #[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
    ::core::marker::StructuralPartialEq for ImplSource<'tcx, N> {
}
#[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
    ::core::cmp::PartialEq for ImplSource<'tcx, N> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::UserDefined(__self_0), Self::UserDefined(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Param(__self_0), Self::Param(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::Builtin(__self_0, __self_1),
                    Self::Builtin(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]impl<'tcx, N: ::core::cmp::Eq> ::core::cmp::Eq for
    ImplSource<'tcx, N> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<ImplSourceUserDefinedData<'tcx,
                N>>;
        let _: ::core::cmp::AssertParamIsEq<ThinVec<N>>;
        let _: ::core::cmp::AssertParamIsEq<BuiltinImplSource>;
        let _: ::core::cmp::AssertParamIsEq<ThinVec<N>>;
    }
}Eq, const _: () =
    {
        impl<'tcx, N, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ImplSource<'tcx, N> where
            ImplSourceUserDefinedData<'tcx,
            N>: ::rustc_serialize::Encodable<__E>,
            ThinVec<N>: ::rustc_serialize::Encodable<__E> {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        ImplSource::UserDefined(ref __binding_0) => { 0usize }
                        ImplSource::Param(ref __binding_0) => { 1usize }
                        ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
                            2usize
                        }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    ImplSource::UserDefined(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ImplSource::Param(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, N, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for ImplSource<'tcx, N> where
            ImplSourceUserDefinedData<'tcx,
            N>: ::rustc_serialize::Decodable<__D>,
            ThinVec<N>: ::rustc_serialize::Decodable<__D> {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => {
                        ImplSource::UserDefined(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    1usize => {
                        ImplSource::Param(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    2usize => {
                        ImplSource::Builtin(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `ImplSource`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable, const _: () =
    {
        impl<'tcx, N> ::rustc_data_structures::stable_hash::StableHash for
            ImplSource<'tcx, N> where
            N: ::rustc_data_structures::stable_hash::StableHash {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ImplSource::UserDefined(ref __binding_0) =>
                        0u8.stable_hash(__hcx, __hasher),
                    ImplSource::Param(ref __binding_0) =>
                        1u8.stable_hash(__hcx, __hasher),
                    ImplSource::Builtin(ref __binding_0, ref __binding_1) =>
                        2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    ImplSource::UserDefined(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ImplSource::Param(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
692#[derive(const _: () =
    {
        impl<'tcx, N>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplSource<'tcx, N> where
            N: ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ImplSource::UserDefined(__binding_0) => {
                            ImplSource::UserDefined(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ImplSource::Param(__binding_0) => {
                            ImplSource::Param(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?)
                        }
                        ImplSource::Builtin(__binding_0, __binding_1) => {
                            ImplSource::Builtin(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?)
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ImplSource::UserDefined(__binding_0) => {
                        ImplSource::UserDefined(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ImplSource::Param(__binding_0) => {
                        ImplSource::Param(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder))
                    }
                    ImplSource::Builtin(__binding_0, __binding_1) => {
                        ImplSource::Builtin(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder))
                    }
                }
            }
        }
    };TypeFoldable, const _: () =
    {
        impl<'tcx, N>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplSource<'tcx, N> where
            N: ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ImplSource::UserDefined(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ImplSource::Param(ref __binding_0) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                    ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
693pub enum ImplSource<'tcx, N> {
694    /// ImplSource identifying a particular impl.
695    UserDefined(ImplSourceUserDefinedData<'tcx, N>),
696
697    /// Successful resolution to an obligation provided by the caller
698    /// for some type parameter. The `Vec<N>` represents the
699    /// obligations incurred from normalizing the where-clause (if
700    /// any).
701    Param(ThinVec<N>),
702
703    /// Successful resolution for a builtin impl.
704    Builtin(BuiltinImplSource, ThinVec<N>),
705}
706
707impl<'tcx, N> ImplSource<'tcx, N> {
708    pub fn nested_obligations(self) -> ThinVec<N> {
709        match self {
710            ImplSource::UserDefined(i) => i.nested,
711            ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
712        }
713    }
714
715    pub fn borrow_nested_obligations(&self) -> &[N] {
716        match self {
717            ImplSource::UserDefined(i) => &i.nested,
718            ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
719        }
720    }
721
722    pub fn borrow_nested_obligations_mut(&mut self) -> &mut [N] {
723        match self {
724            ImplSource::UserDefined(i) => &mut i.nested,
725            ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
726        }
727    }
728
729    pub fn map<M, F>(self, f: F) -> ImplSource<'tcx, M>
730    where
731        F: FnMut(N) -> M,
732    {
733        match self {
734            ImplSource::UserDefined(i) => ImplSource::UserDefined(ImplSourceUserDefinedData {
735                impl_def_id: i.impl_def_id,
736                args: i.args,
737                nested: i.nested.into_iter().map(f).collect(),
738            }),
739            ImplSource::Param(n) => ImplSource::Param(n.into_iter().map(f).collect()),
740            ImplSource::Builtin(source, n) => {
741                ImplSource::Builtin(source, n.into_iter().map(f).collect())
742            }
743        }
744    }
745}
746
747/// Identifies a particular impl in the source, along with a set of
748/// generic parameters from the impl's type/lifetime parameters. The
749/// `nested` vector corresponds to the nested obligations attached to
750/// the impl's type parameters.
751///
752/// The type parameter `N` indicates the type used for "nested
753/// obligations" that are required by the impl. During type-check, this
754/// is `Obligation`, as one might expect. During codegen, however, this
755/// is `()`, because codegen only requires a shallow resolution of an
756/// impl, and nested obligations are satisfied later.
757#[derive(#[automatically_derived]impl<'tcx, N: ::core::clone::Clone>
    ::core::clone::Clone for ImplSourceUserDefinedData<'tcx, N> {
    #[inline]
    fn clone(&self) -> Self {
        ImplSourceUserDefinedData {
            impl_def_id: ::core::clone::Clone::clone(&self.impl_def_id),
            args: ::core::clone::Clone::clone(&self.args),
            nested: ::core::clone::Clone::clone(&self.nested),
        }
    }
}Clone, #[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
    ::core::marker::StructuralPartialEq for ImplSourceUserDefinedData<'tcx, N>
    {
}
#[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
    ::core::cmp::PartialEq for ImplSourceUserDefinedData<'tcx, N> {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        self.impl_def_id == other.impl_def_id && self.args == other.args &&
            self.nested == other.nested
    }
}PartialEq, #[automatically_derived]impl<'tcx, N: ::core::cmp::Eq> ::core::cmp::Eq for
    ImplSourceUserDefinedData<'tcx, N> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<GenericArgs<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ThinVec<N>>;
    }
}Eq, const _: () =
    {
        impl<'tcx, N, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for
            ImplSourceUserDefinedData<'tcx, N> where
            ThinVec<N>: ::rustc_serialize::Encodable<__E> {
            fn encode(&self, __encoder: &mut __E) {
                let ImplSourceUserDefinedData {
                        impl_def_id: ref __binding_0,
                        args: ref __binding_1,
                        nested: ref __binding_2 } = *self;
                ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                    __encoder);
                ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                    __encoder);
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, N, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for
            ImplSourceUserDefinedData<'tcx, N> where
            ThinVec<N>: ::rustc_serialize::Decodable<__D> {
            fn decode(__decoder: &mut __D) -> Self {
                ImplSourceUserDefinedData {
                    impl_def_id: ::rustc_serialize::Decodable::decode(__decoder),
                    args: ::rustc_serialize::Decodable::decode(__decoder),
                    nested: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, const _: () =
    {
        impl<'tcx, N> ::rustc_data_structures::stable_hash::StableHash for
            ImplSourceUserDefinedData<'tcx, N> where
            N: ::rustc_data_structures::stable_hash::StableHash {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    ImplSourceUserDefinedData {
                        impl_def_id: ref __binding_0,
                        args: ref __binding_1,
                        nested: ref __binding_2 } => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
758#[derive(const _: () =
    {
        impl<'tcx, N>
            ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplSourceUserDefinedData<'tcx, N> where
            N: ::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
            {
            fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Result<Self, __F::Error> {
                Ok(match self {
                        ImplSourceUserDefinedData {
                            impl_def_id: __binding_0,
                            args: __binding_1,
                            nested: __binding_2 } => {
                            ImplSourceUserDefinedData {
                                impl_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                args: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
                                        __folder)?,
                                nested: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
                                        __folder)?,
                            }
                        }
                    })
            }
            fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
                __folder: &mut __F) -> Self {
                match self {
                    ImplSourceUserDefinedData {
                        impl_def_id: __binding_0,
                        args: __binding_1,
                        nested: __binding_2 } => {
                        ImplSourceUserDefinedData {
                            impl_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            args: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                            nested: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable, const _: () =
    {
        impl<'tcx, N>
            ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            for ImplSourceUserDefinedData<'tcx, N> where
            N: ::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
            {
            fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
                __visitor: &mut __V) -> __V::Result {
                match *self {
                    ImplSourceUserDefinedData {
                        impl_def_id: ref __binding_0,
                        args: ref __binding_1,
                        nested: ref __binding_2 } => {
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                        {
                            match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
                                        __visitor)) {
                                ::core::ops::ControlFlow::Continue(()) => {}
                                ::core::ops::ControlFlow::Break(r) => {
                                    return ::rustc_middle::ty::VisitorResult::from_residual(r);
                                }
                            }
                        }
                    }
                }
                <__V::Result as ::rustc_middle::ty::VisitorResult>::output()
            }
        }
    };TypeVisitable)]
759pub struct ImplSourceUserDefinedData<'tcx, N> {
760    pub impl_def_id: DefId,
761    pub args: GenericArgs<'tcx>,
762    pub nested: ThinVec<N>,
763}
764
765#[derive(#[automatically_derived]impl ::core::clone::Clone for
    DynCompatibilityViolation {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::ExplicitlyDynIncompatible(__self_0) =>
                DynCompatibilityViolation::ExplicitlyDynIncompatible(::core::clone::Clone::clone(__self_0)),
            Self::SizedSelf(__self_0) =>
                DynCompatibilityViolation::SizedSelf(::core::clone::Clone::clone(__self_0)),
            Self::SupertraitSelf(__self_0) =>
                DynCompatibilityViolation::SupertraitSelf(::core::clone::Clone::clone(__self_0)),
            Self::SupertraitNonLifetimeBinder(__self_0) =>
                DynCompatibilityViolation::SupertraitNonLifetimeBinder(::core::clone::Clone::clone(__self_0)),
            Self::SupertraitConst(__self_0) =>
                DynCompatibilityViolation::SupertraitConst(::core::clone::Clone::clone(__self_0)),
            Self::Method(__self_0, __self_1, __self_2) =>
                DynCompatibilityViolation::Method(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Self::AssocConst(__self_0, __self_1, __self_2) =>
                DynCompatibilityViolation::AssocConst(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Self::GenericAssocTy(__self_0, __self_1) =>
                DynCompatibilityViolation::GenericAssocTy(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for DynCompatibilityViolation
    {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::ExplicitlyDynIncompatible(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ExplicitlyDynIncompatible", &__self_0),
            Self::SizedSelf(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SizedSelf", &__self_0),
            Self::SupertraitSelf(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SupertraitSelf", &__self_0),
            Self::SupertraitNonLifetimeBinder(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SupertraitNonLifetimeBinder", &__self_0),
            Self::SupertraitConst(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "SupertraitConst", &__self_0),
            Self::Method(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Method", __self_0, __self_1, &__self_2),
            Self::AssocConst(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "AssocConst", __self_0, __self_1, &__self_2),
            Self::GenericAssocTy(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "GenericAssocTy", __self_0, &__self_1),
        }
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    DynCompatibilityViolation {
}
#[automatically_derived]impl ::core::cmp::PartialEq for
    DynCompatibilityViolation {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::ExplicitlyDynIncompatible(__self_0),
                    Self::ExplicitlyDynIncompatible(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SizedSelf(__self_0), Self::SizedSelf(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SupertraitSelf(__self_0),
                    Self::SupertraitSelf(__arg1_0)) => __self_0 == __arg1_0,
                (Self::SupertraitNonLifetimeBinder(__self_0),
                    Self::SupertraitNonLifetimeBinder(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::SupertraitConst(__self_0),
                    Self::SupertraitConst(__arg1_0)) => __self_0 == __arg1_0,
                (Self::Method(__self_0, __self_1, __self_2),
                    Self::Method(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::AssocConst(__self_0, __self_1, __self_2),
                    Self::AssocConst(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::GenericAssocTy(__self_0, __self_1),
                    Self::GenericAssocTy(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for DynCompatibilityViolation {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
        let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
        let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
        let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
        let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
        let _: ::core::cmp::AssertParamIsEq<Symbol>;
        let _: ::core::cmp::AssertParamIsEq<MethodViolation>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<AssocConstViolation>;
    }
}Eq, #[automatically_derived]impl ::core::hash::Hash for DynCompatibilityViolation
    {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::ExplicitlyDynIncompatible(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::SizedSelf(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::SupertraitSelf(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::SupertraitNonLifetimeBinder(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::SupertraitConst(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::Method(__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::AssocConst(__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::GenericAssocTy(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
        }
    }
}Hash, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            DynCompatibilityViolation {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    DynCompatibilityViolation::ExplicitlyDynIncompatible(ref __binding_0)
                        => 0u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::SizedSelf(ref __binding_0) =>
                        1u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::SupertraitSelf(ref __binding_0)
                        => 2u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::SupertraitNonLifetimeBinder(ref __binding_0)
                        => 3u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::SupertraitConst(ref __binding_0)
                        => 4u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::Method(ref __binding_0,
                        ref __binding_1, ref __binding_2) =>
                        5u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::AssocConst(ref __binding_0,
                        ref __binding_1, ref __binding_2) =>
                        6u8.stable_hash(__hcx, __hasher),
                    DynCompatibilityViolation::GenericAssocTy(ref __binding_0,
                        ref __binding_1) => 7u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    DynCompatibilityViolation::ExplicitlyDynIncompatible(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SizedSelf(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SupertraitSelf(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SupertraitNonLifetimeBinder(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SupertraitConst(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::Method(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::AssocConst(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                        { __binding_2.stable_hash(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::GenericAssocTy(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                        { __binding_1.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
766pub enum DynCompatibilityViolation {
767    /// Trait is marked `#[rustc_dyn_incompatible_trait]`.
768    ExplicitlyDynIncompatible(SmallVec<[Span; 1]>),
769
770    /// `Self: Sized` declared on the trait.
771    SizedSelf(SmallVec<[Span; 1]>),
772
773    /// Supertrait reference references `Self` an in illegal location
774    /// (e.g., `trait Foo : Bar<Self>`).
775    SupertraitSelf(SmallVec<[Span; 1]>),
776
777    // Supertrait has a non-lifetime `for<T>` binder.
778    SupertraitNonLifetimeBinder(SmallVec<[Span; 1]>),
779
780    // Trait has a `const Trait` supertrait.
781    SupertraitConst(SmallVec<[Span; 1]>),
782
783    /// Method has something illegal.
784    Method(Symbol, MethodViolation, Span),
785
786    /// Associated constant is faulty.
787    AssocConst(Symbol, AssocConstViolation, Span),
788
789    /// Generic associated type (GAT).
790    GenericAssocTy(Symbol, Span),
791}
792
793impl DynCompatibilityViolation {
794    pub fn error_msg(&self) -> Cow<'static, str> {
795        // FIXME(mgca): For method violations we just say "method ..." but for assoc const ones we
796        //              say "it contains ... associated constant ...". Make it consistent.
797
798        match self {
799            Self::ExplicitlyDynIncompatible(_) => "it opted out of dyn-compatibility".into(),
800            Self::SizedSelf(_) => "it requires `Self: Sized`".into(),
801            Self::SupertraitSelf(spans) => {
802                if spans.iter().any(|sp| *sp != DUMMY_SP) {
803                    "it uses `Self` as a type parameter".into()
804                } else {
805                    "it cannot use `Self` as a type parameter in a supertrait or `where`-clause"
806                        .into()
807                }
808            }
809            Self::SupertraitNonLifetimeBinder(_) => {
810                "where clause cannot reference non-lifetime `for<...>` variables".into()
811            }
812            Self::SupertraitConst(_) => "it cannot have a `const` supertrait".into(),
813            Self::Method(name, MethodViolation::StaticMethod(_), _) => {
814                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("associated function `{0}` has no `self` parameter",
                name))
    })format!("associated function `{name}` has no `self` parameter").into()
815            }
816            Self::Method(name, MethodViolation::ReferencesSelfInput(_), DUMMY_SP) => {
817                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` references the `Self` type in its parameters",
                name))
    })format!("method `{name}` references the `Self` type in its parameters").into()
818            }
819            Self::Method(name, MethodViolation::ReferencesSelfInput(_), _) => {
820                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` references the `Self` type in this parameter",
                name))
    })format!("method `{name}` references the `Self` type in this parameter").into()
821            }
822            Self::Method(name, MethodViolation::ReferencesSelfOutput, _) => {
823                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` references the `Self` type in its return type",
                name))
    })format!("method `{name}` references the `Self` type in its return type").into()
824            }
825            Self::Method(name, MethodViolation::ReferencesImplTraitInTrait(_), _) => {
826                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` references an `impl Trait` type in its return type",
                name))
    })format!("method `{name}` references an `impl Trait` type in its return type").into()
827            }
828            Self::Method(name, MethodViolation::AsyncFn, _) => {
829                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` is `async`", name))
    })format!("method `{name}` is `async`").into()
830            }
831            Self::Method(name, MethodViolation::CVariadic, _) => {
832                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` is C-variadic", name))
    })format!("method `{name}` is C-variadic").into()
833            }
834            Self::Method(name, MethodViolation::WhereClauseReferencesSelf, _) => {
835                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` references the `Self` type in its `where` clause",
                name))
    })format!("method `{name}` references the `Self` type in its `where` clause").into()
836            }
837            Self::Method(name, MethodViolation::Generic, _) => {
838                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` has generic type parameters",
                name))
    })format!("method `{name}` has generic type parameters").into()
839            }
840            Self::Method(name, MethodViolation::UndispatchableReceiver(_), _) => {
841                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}`\'s `self` parameter cannot be dispatched on",
                name))
    })format!("method `{name}`'s `self` parameter cannot be dispatched on").into()
842            }
843            Self::AssocConst(name, AssocConstViolation::FeatureNotEnabled, _) => {
844                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains associated const `{0}`",
                name))
    })format!("it contains associated const `{name}`").into()
845            }
846            Self::AssocConst(name, AssocConstViolation::NonType, _) => ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains associated const `{0}` that\'s not defined as `#[rustc_always_gca]`",
                name))
    })format!(
847                "it contains associated const `{name}` that's not defined as `#[rustc_always_gca]`"
848            )
849            .into(),
850            Self::AssocConst(name, AssocConstViolation::Generic, _) => {
851                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains generic associated const `{0}`",
                name))
    })format!("it contains generic associated const `{name}`").into()
852            }
853            Self::AssocConst(name, AssocConstViolation::TypeReferencesSelf, _) => ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains associated const `{0}` whose type references the `Self` type",
                name))
    })format!(
854                "it contains associated const `{name}` whose type references the `Self` type"
855            )
856            .into(),
857            Self::GenericAssocTy(name, _) => {
858                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains generic associated type `{0}`",
                name))
    })format!("it contains generic associated type `{name}`").into()
859            }
860        }
861    }
862
863    pub fn solution(&self) -> DynCompatibilityViolationSolution {
864        match self {
865            Self::ExplicitlyDynIncompatible(_)
866            | Self::SizedSelf(_)
867            | Self::SupertraitSelf(_)
868            | Self::SupertraitNonLifetimeBinder(..)
869            | Self::SupertraitConst(_) => DynCompatibilityViolationSolution::None,
870            Self::Method(
871                name,
872                MethodViolation::StaticMethod(Some(((add_s, add_sp), (make_s, make_sp)))),
873                _,
874            ) => DynCompatibilityViolationSolution::AddSelfOrMakeSized {
875                name: *name,
876                add_self_sugg: (add_s.clone(), OrdSpan(*add_sp)),
877                make_sized_sugg: (make_s.clone(), OrdSpan(*make_sp)),
878            },
879            Self::Method(name, MethodViolation::UndispatchableReceiver(Some((span, lt))), _) => {
880                DynCompatibilityViolationSolution::ChangeToRefSelf(*name, OrdSpan(*span), *lt)
881            }
882            Self::Method(name, ..) | Self::AssocConst(name, ..) | Self::GenericAssocTy(name, _) => {
883                DynCompatibilityViolationSolution::MoveToAnotherTrait(*name)
884            }
885        }
886    }
887
888    pub fn spans(&self) -> SmallVec<[Span; 1]> {
889        // When `span` comes from a separate crate, it'll be `DUMMY_SP`. Treat it as `None` so
890        // diagnostics use a `note` instead of a `span_label`.
891        match self {
892            Self::ExplicitlyDynIncompatible(spans)
893            | Self::SizedSelf(spans)
894            | Self::SupertraitSelf(spans)
895            | Self::SupertraitNonLifetimeBinder(spans)
896            | Self::SupertraitConst(spans) => spans.clone(),
897            Self::Method(_, _, span)
898            | Self::AssocConst(_, _, span)
899            | Self::GenericAssocTy(_, span) => {
900                if *span != DUMMY_SP {
901                    {
    let count = 0usize + 1usize;
    let mut vec = ::smallvec::SmallVec::new();
    if count <= vec.inline_size() {
        vec.push(*span);
        vec
    } else {
        ::smallvec::SmallVec::from_vec(::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                    [*span])))
    }
}smallvec![*span]
902                } else {
903                    ::smallvec::SmallVec::new()smallvec![]
904                }
905            }
906        }
907    }
908}
909
910#[derive(#[automatically_derived]impl ::core::clone::Clone for
    DynCompatibilityViolationSolution {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::None => DynCompatibilityViolationSolution::None,
            Self::AddSelfOrMakeSized {
                name: __self_0,
                add_self_sugg: __self_1,
                make_sized_sugg: __self_2 } =>
                DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                    name: ::core::clone::Clone::clone(__self_0),
                    add_self_sugg: ::core::clone::Clone::clone(__self_1),
                    make_sized_sugg: ::core::clone::Clone::clone(__self_2),
                },
            Self::ChangeToRefSelf(__self_0, __self_1, __self_2) =>
                DynCompatibilityViolationSolution::ChangeToRefSelf(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1),
                    ::core::clone::Clone::clone(__self_2)),
            Self::MoveToAnotherTrait(__self_0) =>
                DynCompatibilityViolationSolution::MoveToAnotherTrait(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for
    DynCompatibilityViolationSolution {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::None => ::core::fmt::Formatter::write_str(f, "None"),
            Self::AddSelfOrMakeSized {
                name: __self_0,
                add_self_sugg: __self_1,
                make_sized_sugg: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "AddSelfOrMakeSized name add_self_sugg make_sized_sugg",
                    __self_0, __self_1, &__self_2),
            Self::ChangeToRefSelf(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "ChangeToRefSelf", __self_0, __self_1, &__self_2),
            Self::MoveToAnotherTrait(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "MoveToAnotherTrait", &__self_0),
        }
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    DynCompatibilityViolationSolution {
}
#[automatically_derived]impl ::core::cmp::PartialEq for
    DynCompatibilityViolationSolution {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::AddSelfOrMakeSized {
                    name: __self_0,
                    add_self_sugg: __self_1,
                    make_sized_sugg: __self_2 }, Self::AddSelfOrMakeSized {
                    name: __arg1_0,
                    add_self_sugg: __arg1_1,
                    make_sized_sugg: __arg1_2 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::ChangeToRefSelf(__self_0, __self_1, __self_2),
                    Self::ChangeToRefSelf(__arg1_0, __arg1_1, __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (Self::MoveToAnotherTrait(__self_0),
                    Self::MoveToAnotherTrait(__arg1_0)) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for
    DynCompatibilityViolationSolution {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Symbol>;
        let _: ::core::cmp::AssertParamIsEq<(String, OrdSpan)>;
        let _: ::core::cmp::AssertParamIsEq<(String, OrdSpan)>;
        let _: ::core::cmp::AssertParamIsEq<OrdSpan>;
    }
}Eq, #[automatically_derived]impl ::core::cmp::PartialOrd for
    DynCompatibilityViolationSolution {
    #[inline]
    fn partial_cmp(&self, other: &Self)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}PartialOrd, #[automatically_derived]impl ::core::cmp::Ord for
    DynCompatibilityViolationSolution {
    #[inline]
    fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
        match (self, other) {
            (Self::AddSelfOrMakeSized {
                name: __self_0,
                add_self_sugg: __self_1,
                make_sized_sugg: __self_2 }, Self::AddSelfOrMakeSized {
                name: __arg1_0,
                add_self_sugg: __arg1_1,
                make_sized_sugg: __arg1_2 }) =>
                match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                    ::core::cmp::Ordering::Equal =>
                        match ::core::cmp::Ord::cmp(__self_1, __arg1_1) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_2, __arg1_2),
                            cmp => cmp,
                        },
                    cmp => cmp,
                },
            (Self::ChangeToRefSelf(__self_0, __self_1, __self_2),
                Self::ChangeToRefSelf(__arg1_0, __arg1_1, __arg1_2)) =>
                match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                    ::core::cmp::Ordering::Equal =>
                        match ::core::cmp::Ord::cmp(__self_1, __arg1_1) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_2, __arg1_2),
                            cmp => cmp,
                        },
                    cmp => cmp,
                },
            (Self::MoveToAnotherTrait(__self_0),
                Self::MoveToAnotherTrait(__arg1_0)) =>
                ::core::cmp::Ord::cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::Ord::cmp(&::core::intrinsics::discriminant_value(self),
                    &::core::intrinsics::discriminant_value(other)),
        }
    }
}Ord)]
911pub enum DynCompatibilityViolationSolution {
912    None,
913    AddSelfOrMakeSized {
914        name: Symbol,
915        add_self_sugg: (String, OrdSpan),
916        make_sized_sugg: (String, OrdSpan),
917    },
918    ChangeToRefSelf(Symbol, OrdSpan, Symbol),
919    MoveToAnotherTrait(Symbol),
920}
921
922impl DynCompatibilityViolationSolution {
923    pub fn add_to(self, err: &mut Diag<'_>) {
924        match self {
925            DynCompatibilityViolationSolution::None => {}
926            DynCompatibilityViolationSolution::AddSelfOrMakeSized {
927                name,
928                add_self_sugg,
929                make_sized_sugg,
930            } => {
931                err.span_suggestion_verbose(
932                    add_self_sugg.1.0,
933                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("consider turning `{0}` into a method by giving it a `&self` argument, so that it is accessible through the trait object\'s vtable",
                name))
    })format!(
934                        "consider turning `{name}` into a method by giving it a `&self` argument, \
935                         so that it is accessible through the trait object's vtable",
936                    ),
937                    add_self_sugg.0,
938                    Applicability::MaybeIncorrect,
939                );
940                err.span_suggestion_verbose(
941                    make_sized_sugg.1.0,
942                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("alternatively, consider constraining `{0}` so it is explicitly marked as not applying to trait objects",
                name))
    })format!(
943                        "alternatively, consider constraining `{name}` so it is explicitly marked \
944                         as not applying to trait objects",
945                    ),
946                    make_sized_sugg.0,
947                    Applicability::MaybeIncorrect,
948                );
949            }
950            DynCompatibilityViolationSolution::ChangeToRefSelf(name, span, lt) => {
951                err.span_suggestion_verbose(
952                    span.0,
953                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("consider changing method `{0}`\'s `self` parameter to be `&self`",
                name))
    })format!("consider changing method `{name}`'s `self` parameter to be `&self`"),
954                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("&{1}{0}self",
                if lt != sym::empty { " " } else { "" }, lt))
    })format!("&{lt}{}self", if lt != sym::empty { " " } else { "" }),
955                    Applicability::MachineApplicable,
956                );
957            }
958            DynCompatibilityViolationSolution::MoveToAnotherTrait(name) => {
959                err.help(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("consider moving `{0}` to another trait",
                name))
    })format!("consider moving `{name}` to another trait"));
960            }
961        }
962    }
963}
964
965/// Reasons a method might not be dyn-compatible.
966#[derive(#[automatically_derived]impl ::core::clone::Clone for MethodViolation {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::StaticMethod(__self_0) =>
                MethodViolation::StaticMethod(::core::clone::Clone::clone(__self_0)),
            Self::ReferencesSelfInput(__self_0) =>
                MethodViolation::ReferencesSelfInput(::core::clone::Clone::clone(__self_0)),
            Self::ReferencesSelfOutput =>
                MethodViolation::ReferencesSelfOutput,
            Self::ReferencesImplTraitInTrait(__self_0) =>
                MethodViolation::ReferencesImplTraitInTrait(::core::clone::Clone::clone(__self_0)),
            Self::AsyncFn => MethodViolation::AsyncFn,
            Self::WhereClauseReferencesSelf =>
                MethodViolation::WhereClauseReferencesSelf,
            Self::Generic => MethodViolation::Generic,
            Self::CVariadic => MethodViolation::CVariadic,
            Self::UndispatchableReceiver(__self_0) =>
                MethodViolation::UndispatchableReceiver(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for MethodViolation {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::StaticMethod(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "StaticMethod", &__self_0),
            Self::ReferencesSelfInput(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ReferencesSelfInput", &__self_0),
            Self::ReferencesSelfOutput =>
                ::core::fmt::Formatter::write_str(f, "ReferencesSelfOutput"),
            Self::ReferencesImplTraitInTrait(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ReferencesImplTraitInTrait", &__self_0),
            Self::AsyncFn => ::core::fmt::Formatter::write_str(f, "AsyncFn"),
            Self::WhereClauseReferencesSelf =>
                ::core::fmt::Formatter::write_str(f,
                    "WhereClauseReferencesSelf"),
            Self::Generic => ::core::fmt::Formatter::write_str(f, "Generic"),
            Self::CVariadic =>
                ::core::fmt::Formatter::write_str(f, "CVariadic"),
            Self::UndispatchableReceiver(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "UndispatchableReceiver", &__self_0),
        }
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    MethodViolation {
}
#[automatically_derived]impl ::core::cmp::PartialEq for MethodViolation {
    #[inline]
    fn eq(&self, other: &Self) -> bool {
        ::core::intrinsics::discriminant_value(self) ==
                ::core::intrinsics::discriminant_value(other) &&
            match (self, other) {
                (Self::StaticMethod(__self_0), Self::StaticMethod(__arg1_0))
                    => __self_0 == __arg1_0,
                (Self::ReferencesSelfInput(__self_0),
                    Self::ReferencesSelfInput(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::ReferencesImplTraitInTrait(__self_0),
                    Self::ReferencesImplTraitInTrait(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (Self::UndispatchableReceiver(__self_0),
                    Self::UndispatchableReceiver(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for MethodViolation {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<Option<((String, Span),
                (String, Span))>>;
        let _: ::core::cmp::AssertParamIsEq<Option<Span>>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<Option<(Span, Symbol)>>;
    }
}Eq, #[automatically_derived]impl ::core::hash::Hash for MethodViolation {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::StaticMethod(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::ReferencesSelfInput(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::ReferencesImplTraitInTrait(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            Self::UndispatchableReceiver(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            MethodViolation {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    MethodViolation::StaticMethod(ref __binding_0) =>
                        0u8.stable_hash(__hcx, __hasher),
                    MethodViolation::ReferencesSelfInput(ref __binding_0) =>
                        1u8.stable_hash(__hcx, __hasher),
                    MethodViolation::ReferencesSelfOutput =>
                        2u8.stable_hash(__hcx, __hasher),
                    MethodViolation::ReferencesImplTraitInTrait(ref __binding_0)
                        => 3u8.stable_hash(__hcx, __hasher),
                    MethodViolation::AsyncFn =>
                        4u8.stable_hash(__hcx, __hasher),
                    MethodViolation::WhereClauseReferencesSelf =>
                        5u8.stable_hash(__hcx, __hasher),
                    MethodViolation::Generic =>
                        6u8.stable_hash(__hcx, __hasher),
                    MethodViolation::CVariadic =>
                        7u8.stable_hash(__hcx, __hasher),
                    MethodViolation::UndispatchableReceiver(ref __binding_0) =>
                        8u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    MethodViolation::StaticMethod(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    MethodViolation::ReferencesSelfInput(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    MethodViolation::ReferencesSelfOutput => {}
                    MethodViolation::ReferencesImplTraitInTrait(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                    MethodViolation::AsyncFn => {}
                    MethodViolation::WhereClauseReferencesSelf => {}
                    MethodViolation::Generic => {}
                    MethodViolation::CVariadic => {}
                    MethodViolation::UndispatchableReceiver(ref __binding_0) =>
                        {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
967pub enum MethodViolation {
968    /// e.g., `fn foo()`
969    StaticMethod(Option<(/* add &self */ (String, Span), /* add Self: Sized */ (String, Span))>),
970
971    /// e.g., `fn foo(&self, x: Self)`
972    ReferencesSelfInput(Option<Span>),
973
974    /// e.g., `fn foo(&self) -> Self`
975    ReferencesSelfOutput,
976
977    /// e.g., `fn foo(&self) -> impl Sized`
978    ReferencesImplTraitInTrait(Span),
979
980    /// e.g., `async fn foo(&self)`
981    AsyncFn,
982
983    /// e.g., `fn foo(&self) where Self: Clone`
984    WhereClauseReferencesSelf,
985
986    /// e.g., `fn foo<A>()`
987    Generic,
988
989    /// e.g., `fn (mut ap: ...)`
990    CVariadic,
991
992    /// The method's receiver (`self` argument) can't be dispatched on
993    ///
994    /// The `Span` points at the receiver. The `Symbol` is the lifetime's name `'a` when we have
995    /// Arbitrary Self Types like `self: &'a ()`.
996    UndispatchableReceiver(Option<(Span, Symbol)>),
997}
998
999/// Reasons an associated const might not be dyn compatible.
1000#[derive(#[automatically_derived]impl ::core::clone::Clone for AssocConstViolation {
    #[inline]
    fn clone(&self) -> Self {
        match self {
            Self::FeatureNotEnabled => AssocConstViolation::FeatureNotEnabled,
            Self::NonType => AssocConstViolation::NonType,
            Self::Generic => AssocConstViolation::Generic,
            Self::TypeReferencesSelf =>
                AssocConstViolation::TypeReferencesSelf,
        }
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for AssocConstViolation {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                AssocConstViolation::FeatureNotEnabled => "FeatureNotEnabled",
                AssocConstViolation::NonType => "NonType",
                AssocConstViolation::Generic => "Generic",
                AssocConstViolation::TypeReferencesSelf =>
                    "TypeReferencesSelf",
            })
    }
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
    AssocConstViolation {
}
#[automatically_derived]impl ::core::cmp::PartialEq for AssocConstViolation {
    #[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 AssocConstViolation { }Eq, #[automatically_derived]impl ::core::hash::Hash for AssocConstViolation {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state)
    }
}Hash, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            AssocConstViolation {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    AssocConstViolation::FeatureNotEnabled =>
                        0u8.stable_hash(__hcx, __hasher),
                    AssocConstViolation::NonType =>
                        1u8.stable_hash(__hcx, __hasher),
                    AssocConstViolation::Generic =>
                        2u8.stable_hash(__hcx, __hasher),
                    AssocConstViolation::TypeReferencesSelf =>
                        3u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    AssocConstViolation::FeatureNotEnabled => {}
                    AssocConstViolation::NonType => {}
                    AssocConstViolation::Generic => {}
                    AssocConstViolation::TypeReferencesSelf => {}
                }
            }
        }
    };StableHash)]
1001pub enum AssocConstViolation {
1002    /// Unstable feature `gca_min_const_items` wasn't enabled.
1003    FeatureNotEnabled,
1004
1005    /// Not defined as a type-level associated const.
1006    NonType,
1007
1008    /// Has own generic parameters (GAC).
1009    Generic,
1010
1011    /// Its type mentions the `Self` type parameter.
1012    TypeReferencesSelf,
1013}
1014
1015/// These are the error cases for `codegen_select_candidate`.
1016#[derive(#[automatically_derived]impl ::core::marker::Copy for CodegenObligationError {
}Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
    for CodegenObligationError {
}
#[automatically_derived]impl ::core::clone::Clone for CodegenObligationError {
    #[inline]
    fn clone(&self) -> Self {
        let _: ::core::clone::AssertParamIsClone<ErrorGuaranteed>;
        *self
    }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for CodegenObligationError {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Self::Ambiguity =>
                ::core::fmt::Formatter::write_str(f, "Ambiguity"),
            Self::Unimplemented =>
                ::core::fmt::Formatter::write_str(f, "Unimplemented"),
            Self::UnconstrainedParam(__self_0) =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "UnconstrainedParam", &__self_0),
        }
    }
}Debug, #[automatically_derived]impl ::core::hash::Hash for CodegenObligationError {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
            state);
        match self {
            Self::UnconstrainedParam(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            CodegenObligationError {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    CodegenObligationError::Ambiguity =>
                        0u8.stable_hash(__hcx, __hasher),
                    CodegenObligationError::Unimplemented =>
                        1u8.stable_hash(__hcx, __hasher),
                    CodegenObligationError::UnconstrainedParam(ref __binding_0)
                        => 2u8.stable_hash(__hcx, __hasher),
                }
                match *self {
                    CodegenObligationError::Ambiguity => {}
                    CodegenObligationError::Unimplemented => {}
                    CodegenObligationError::UnconstrainedParam(ref __binding_0)
                        => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for CodegenObligationError {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        CodegenObligationError::Ambiguity => { 0usize }
                        CodegenObligationError::Unimplemented => { 1usize }
                        CodegenObligationError::UnconstrainedParam(ref __binding_0)
                            => {
                            2usize
                        }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    CodegenObligationError::Ambiguity => {}
                    CodegenObligationError::Unimplemented => {}
                    CodegenObligationError::UnconstrainedParam(ref __binding_0)
                        => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for CodegenObligationError {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { CodegenObligationError::Ambiguity }
                    1usize => { CodegenObligationError::Unimplemented }
                    2usize => {
                        CodegenObligationError::UnconstrainedParam(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `CodegenObligationError`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
1017pub enum CodegenObligationError {
1018    /// Ambiguity can happen when monomorphizing during trans
1019    /// expands to some humongous type that never occurred
1020    /// statically -- this humongous type can then overflow,
1021    /// leading to an ambiguous result. So report this as an
1022    /// overflow bug, since I believe this is the only case
1023    /// where ambiguity can result.
1024    Ambiguity,
1025    /// This can trigger when we have a global bound that is not actually satisfied
1026    /// due to trivial bounds.
1027    Unimplemented,
1028    /// The selected impl has unconstrained generic parameters. This will emit an error
1029    /// during impl WF checking.
1030    UnconstrainedParam(ErrorGuaranteed),
1031}