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, EmissionGuarantee, ErrorGuaranteed};
17use rustc_hir as hir;
18use rustc_hir::HirId;
19use rustc_hir::def_id::DefId;
20use rustc_macros::{
21    Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
22};
23use rustc_span::def_id::{CRATE_DEF_ID, LocalDefId};
24use rustc_span::{DUMMY_SP, Span, Symbol};
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, GenericArgsRef, 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) -> ObligationCause<'tcx> {
        ObligationCause {
            span: ::core::clone::Clone::clone(&self.span),
            body_id: ::core::clone::Clone::clone(&self.body_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", &self.span, "body_id", &self.body_id,
            "code", &&self.code)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ObligationCause<'tcx> {
    #[inline]
    fn eq(&self, other: &ObligationCause<'tcx>) -> bool {
        self.span == other.span && self.body_id == other.body_id &&
            self.code == other.code
    }
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for ObligationCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ObligationCause<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    ObligationCause {
                        span: ref __binding_0,
                        body_id: ref __binding_1,
                        code: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ObligationCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    ObligationCause {
                        span: ref __binding_0,
                        body_id: ref __binding_1,
                        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);
                    }
                }
            }
        }
    };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_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_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_id: __binding_1, code: __binding_2 }
                            => {
                            ObligationCause {
                                span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __folder)?,
                                body_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_id: __binding_1, code: __binding_2 }
                        => {
                        ObligationCause {
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            body_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 body 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_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_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_id: LocalDefId,
75        code: ObligationCauseCode<'tcx>,
76    ) -> ObligationCause<'tcx> {
77        ObligationCause { span, body_id, code: code.into() }
78    }
79
80    pub fn misc(span: Span, body_id: LocalDefId) -> ObligationCause<'tcx> {
81        ObligationCause::new(span, body_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_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::PolyTraitPredicate<'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_pred: ty::Binder<'tcx, ty::HostEffectPredicate<'tcx>>,
131        variant: impl FnOnce(DerivedHostCause<'tcx>) -> ObligationCauseCode<'tcx>,
132    ) -> ObligationCause<'tcx> {
133        self.code = variant(DerivedHostCause { parent_host_pred, 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) => {
141                ConstraintCategory::Predicate(*predicate_span)
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) -> ObligationCauseCodeHandle<'tcx> {
        ObligationCauseCodeHandle {
            code: ::core::clone::Clone::clone(&self.code),
        }
    }
}Clone, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ObligationCauseCodeHandle<'tcx> {
    #[inline]
    fn eq(&self, other: &ObligationCauseCodeHandle<'tcx>) -> bool {
        self.code == other.code
    }
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for ObligationCauseCodeHandle<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<Option<Arc<ObligationCauseCode<'tcx>>>>;
    }
}Eq, #[automatically_derived]
impl<'tcx> ::core::default::Default for ObligationCauseCodeHandle<'tcx> {
    #[inline]
    fn default() -> ObligationCauseCodeHandle<'tcx> {
        ObligationCauseCodeHandle {
            code: ::core::default::Default::default(),
        }
    }
}Default, const _: () =
    {
        impl<'tcx, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ObligationCauseCodeHandle<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    ObligationCauseCodeHandle { code: ref __binding_0 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
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) {
                match *self {
                    ObligationCauseCodeHandle { code: ref __binding_0 } => {
                        ::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) -> ObligationCauseCode<'tcx> {
        match self {
            ObligationCauseCode::Misc => ObligationCauseCode::Misc,
            ObligationCauseCode::SliceOrArrayElem =>
                ObligationCauseCode::SliceOrArrayElem,
            ObligationCauseCode::ArrayLen(__self_0) =>
                ObligationCauseCode::ArrayLen(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::TupleElem => ObligationCauseCode::TupleElem,
            ObligationCauseCode::WhereClause(__self_0, __self_1) =>
                ObligationCauseCode::WhereClause(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ObligationCauseCode::OpaqueTypeBound(__self_0, __self_1) =>
                ObligationCauseCode::OpaqueTypeBound(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ObligationCauseCode::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)),
            ObligationCauseCode::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)),
            ObligationCauseCode::ReferenceOutlivesReferent(__self_0) =>
                ObligationCauseCode::ReferenceOutlivesReferent(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::ObjectTypeBound(__self_0, __self_1) =>
                ObligationCauseCode::ObjectTypeBound(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ObligationCauseCode::Coercion { source: __self_0, target: __self_1
                } =>
                ObligationCauseCode::Coercion {
                    source: ::core::clone::Clone::clone(__self_0),
                    target: ::core::clone::Clone::clone(__self_1),
                },
            ObligationCauseCode::AssignmentLhsSized =>
                ObligationCauseCode::AssignmentLhsSized,
            ObligationCauseCode::TupleInitializerSized =>
                ObligationCauseCode::TupleInitializerSized,
            ObligationCauseCode::StructInitializerSized =>
                ObligationCauseCode::StructInitializerSized,
            ObligationCauseCode::VariableType(__self_0) =>
                ObligationCauseCode::VariableType(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::SizedArgumentType(__self_0) =>
                ObligationCauseCode::SizedArgumentType(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::SizedReturnType =>
                ObligationCauseCode::SizedReturnType,
            ObligationCauseCode::SizedCallReturnType =>
                ObligationCauseCode::SizedCallReturnType,
            ObligationCauseCode::SizedYieldType =>
                ObligationCauseCode::SizedYieldType,
            ObligationCauseCode::InlineAsmSized =>
                ObligationCauseCode::InlineAsmSized,
            ObligationCauseCode::SizedClosureCapture(__self_0) =>
                ObligationCauseCode::SizedClosureCapture(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::SizedCoroutineInterior(__self_0) =>
                ObligationCauseCode::SizedCoroutineInterior(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::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),
                },
            ObligationCauseCode::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),
                },
            ObligationCauseCode::SizedConstOrStatic =>
                ObligationCauseCode::SizedConstOrStatic,
            ObligationCauseCode::SharedStatic =>
                ObligationCauseCode::SharedStatic,
            ObligationCauseCode::BuiltinDerived(__self_0) =>
                ObligationCauseCode::BuiltinDerived(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::ImplDerived(__self_0) =>
                ObligationCauseCode::ImplDerived(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::WellFormedDerived(__self_0) =>
                ObligationCauseCode::WellFormedDerived(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::ImplDerivedHost(__self_0) =>
                ObligationCauseCode::ImplDerivedHost(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::BuiltinDerivedHost(__self_0) =>
                ObligationCauseCode::BuiltinDerivedHost(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::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),
                },
            ObligationCauseCode::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),
                },
            ObligationCauseCode::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),
                },
            ObligationCauseCode::ExprAssignable =>
                ObligationCauseCode::ExprAssignable,
            ObligationCauseCode::MatchExpressionArm(__self_0) =>
                ObligationCauseCode::MatchExpressionArm(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::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),
                },
            ObligationCauseCode::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),
                },
            ObligationCauseCode::IfExpressionWithNoElse =>
                ObligationCauseCode::IfExpressionWithNoElse,
            ObligationCauseCode::MainFunctionType =>
                ObligationCauseCode::MainFunctionType,
            ObligationCauseCode::LangFunctionType(__self_0) =>
                ObligationCauseCode::LangFunctionType(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::IntrinsicType =>
                ObligationCauseCode::IntrinsicType,
            ObligationCauseCode::LetElse => ObligationCauseCode::LetElse,
            ObligationCauseCode::MethodReceiver =>
                ObligationCauseCode::MethodReceiver,
            ObligationCauseCode::ReturnNoExpression =>
                ObligationCauseCode::ReturnNoExpression,
            ObligationCauseCode::ReturnValue(__self_0) =>
                ObligationCauseCode::ReturnValue(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::OpaqueReturnType(__self_0) =>
                ObligationCauseCode::OpaqueReturnType(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::BlockTailExpression(__self_0, __self_1) =>
                ObligationCauseCode::BlockTailExpression(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ObligationCauseCode::TrivialBound =>
                ObligationCauseCode::TrivialBound,
            ObligationCauseCode::AwaitableExpr(__self_0) =>
                ObligationCauseCode::AwaitableExpr(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::ForLoopIterator =>
                ObligationCauseCode::ForLoopIterator,
            ObligationCauseCode::QuestionMark =>
                ObligationCauseCode::QuestionMark,
            ObligationCauseCode::WellFormed(__self_0) =>
                ObligationCauseCode::WellFormed(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::MatchImpl(__self_0, __self_1) =>
                ObligationCauseCode::MatchImpl(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            ObligationCauseCode::UnOp { hir_id: __self_0 } =>
                ObligationCauseCode::UnOp {
                    hir_id: ::core::clone::Clone::clone(__self_0),
                },
            ObligationCauseCode::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),
                },
            ObligationCauseCode::AscribeUserTypeProvePredicate(__self_0) =>
                ObligationCauseCode::AscribeUserTypeProvePredicate(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::RustCall => ObligationCauseCode::RustCall,
            ObligationCauseCode::DynCompatible(__self_0) =>
                ObligationCauseCode::DynCompatible(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::AlwaysApplicableImpl =>
                ObligationCauseCode::AlwaysApplicableImpl,
            ObligationCauseCode::ConstParam(__self_0) =>
                ObligationCauseCode::ConstParam(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::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)),
            ObligationCauseCode::UnsizedNonPlaceExpr(__self_0) =>
                ObligationCauseCode::UnsizedNonPlaceExpr(::core::clone::Clone::clone(__self_0)),
            ObligationCauseCode::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 {
            ObligationCauseCode::Misc =>
                ::core::fmt::Formatter::write_str(f, "Misc"),
            ObligationCauseCode::SliceOrArrayElem =>
                ::core::fmt::Formatter::write_str(f, "SliceOrArrayElem"),
            ObligationCauseCode::ArrayLen(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ArrayLen", &__self_0),
            ObligationCauseCode::TupleElem =>
                ::core::fmt::Formatter::write_str(f, "TupleElem"),
            ObligationCauseCode::WhereClause(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "WhereClause", __self_0, &__self_1),
            ObligationCauseCode::OpaqueTypeBound(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "OpaqueTypeBound", __self_0, &__self_1),
            ObligationCauseCode::WhereClauseInExpr(__self_0, __self_1,
                __self_2, __self_3) =>
                ::core::fmt::Formatter::debug_tuple_field4_finish(f,
                    "WhereClauseInExpr", __self_0, __self_1, __self_2,
                    &__self_3),
            ObligationCauseCode::HostEffectInExpr(__self_0, __self_1,
                __self_2, __self_3) =>
                ::core::fmt::Formatter::debug_tuple_field4_finish(f,
                    "HostEffectInExpr", __self_0, __self_1, __self_2,
                    &__self_3),
            ObligationCauseCode::ReferenceOutlivesReferent(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ReferenceOutlivesReferent", &__self_0),
            ObligationCauseCode::ObjectTypeBound(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "ObjectTypeBound", __self_0, &__self_1),
            ObligationCauseCode::Coercion { source: __self_0, target: __self_1
                } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Coercion", "source", __self_0, "target", &__self_1),
            ObligationCauseCode::AssignmentLhsSized =>
                ::core::fmt::Formatter::write_str(f, "AssignmentLhsSized"),
            ObligationCauseCode::TupleInitializerSized =>
                ::core::fmt::Formatter::write_str(f, "TupleInitializerSized"),
            ObligationCauseCode::StructInitializerSized =>
                ::core::fmt::Formatter::write_str(f,
                    "StructInitializerSized"),
            ObligationCauseCode::VariableType(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "VariableType", &__self_0),
            ObligationCauseCode::SizedArgumentType(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SizedArgumentType", &__self_0),
            ObligationCauseCode::SizedReturnType =>
                ::core::fmt::Formatter::write_str(f, "SizedReturnType"),
            ObligationCauseCode::SizedCallReturnType =>
                ::core::fmt::Formatter::write_str(f, "SizedCallReturnType"),
            ObligationCauseCode::SizedYieldType =>
                ::core::fmt::Formatter::write_str(f, "SizedYieldType"),
            ObligationCauseCode::InlineAsmSized =>
                ::core::fmt::Formatter::write_str(f, "InlineAsmSized"),
            ObligationCauseCode::SizedClosureCapture(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SizedClosureCapture", &__self_0),
            ObligationCauseCode::SizedCoroutineInterior(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SizedCoroutineInterior", &__self_0),
            ObligationCauseCode::RepeatElementCopy {
                is_constable: __self_0, elt_span: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "RepeatElementCopy", "is_constable", __self_0, "elt_span",
                    &__self_1),
            ObligationCauseCode::FieldSized {
                adt_kind: __self_0, span: __self_1, last: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "FieldSized", "adt_kind", __self_0, "span", __self_1,
                    "last", &__self_2),
            ObligationCauseCode::SizedConstOrStatic =>
                ::core::fmt::Formatter::write_str(f, "SizedConstOrStatic"),
            ObligationCauseCode::SharedStatic =>
                ::core::fmt::Formatter::write_str(f, "SharedStatic"),
            ObligationCauseCode::BuiltinDerived(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "BuiltinDerived", &__self_0),
            ObligationCauseCode::ImplDerived(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ImplDerived", &__self_0),
            ObligationCauseCode::WellFormedDerived(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WellFormedDerived", &__self_0),
            ObligationCauseCode::ImplDerivedHost(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ImplDerivedHost", &__self_0),
            ObligationCauseCode::BuiltinDerivedHost(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "BuiltinDerivedHost", &__self_0),
            ObligationCauseCode::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", __self_0, "call_hir_id",
                    __self_1, "parent_code", &__self_2),
            ObligationCauseCode::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", __self_0,
                    "trait_item_def_id", __self_1, "kind", &__self_2),
            ObligationCauseCode::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", __self_0,
                    "trait_item_def_id", &__self_1),
            ObligationCauseCode::ExprAssignable =>
                ::core::fmt::Formatter::write_str(f, "ExprAssignable"),
            ObligationCauseCode::MatchExpressionArm(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "MatchExpressionArm", &__self_0),
            ObligationCauseCode::Pattern {
                span: __self_0, root_ty: __self_1, origin_expr: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "Pattern", "span", __self_0, "root_ty", __self_1,
                    "origin_expr", &__self_2),
            ObligationCauseCode::IfExpression {
                expr_id: __self_0,
                tail_defines_return_position_impl_trait: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "IfExpression", "expr_id", __self_0,
                    "tail_defines_return_position_impl_trait", &__self_1),
            ObligationCauseCode::IfExpressionWithNoElse =>
                ::core::fmt::Formatter::write_str(f,
                    "IfExpressionWithNoElse"),
            ObligationCauseCode::MainFunctionType =>
                ::core::fmt::Formatter::write_str(f, "MainFunctionType"),
            ObligationCauseCode::LangFunctionType(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LangFunctionType", &__self_0),
            ObligationCauseCode::IntrinsicType =>
                ::core::fmt::Formatter::write_str(f, "IntrinsicType"),
            ObligationCauseCode::LetElse =>
                ::core::fmt::Formatter::write_str(f, "LetElse"),
            ObligationCauseCode::MethodReceiver =>
                ::core::fmt::Formatter::write_str(f, "MethodReceiver"),
            ObligationCauseCode::ReturnNoExpression =>
                ::core::fmt::Formatter::write_str(f, "ReturnNoExpression"),
            ObligationCauseCode::ReturnValue(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ReturnValue", &__self_0),
            ObligationCauseCode::OpaqueReturnType(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "OpaqueReturnType", &__self_0),
            ObligationCauseCode::BlockTailExpression(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "BlockTailExpression", __self_0, &__self_1),
            ObligationCauseCode::TrivialBound =>
                ::core::fmt::Formatter::write_str(f, "TrivialBound"),
            ObligationCauseCode::AwaitableExpr(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AwaitableExpr", &__self_0),
            ObligationCauseCode::ForLoopIterator =>
                ::core::fmt::Formatter::write_str(f, "ForLoopIterator"),
            ObligationCauseCode::QuestionMark =>
                ::core::fmt::Formatter::write_str(f, "QuestionMark"),
            ObligationCauseCode::WellFormed(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WellFormed", &__self_0),
            ObligationCauseCode::MatchImpl(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "MatchImpl", __self_0, &__self_1),
            ObligationCauseCode::UnOp { hir_id: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "UnOp",
                    "hir_id", &__self_0),
            ObligationCauseCode::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", __self_0, "rhs_hir_id", __self_1, "rhs_span",
                    __self_2, "rhs_is_lit", __self_3, "output_ty", &__self_4),
            ObligationCauseCode::AscribeUserTypeProvePredicate(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "AscribeUserTypeProvePredicate", &__self_0),
            ObligationCauseCode::RustCall =>
                ::core::fmt::Formatter::write_str(f, "RustCall"),
            ObligationCauseCode::DynCompatible(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "DynCompatible", &__self_0),
            ObligationCauseCode::AlwaysApplicableImpl =>
                ::core::fmt::Formatter::write_str(f, "AlwaysApplicableImpl"),
            ObligationCauseCode::ConstParam(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ConstParam", &__self_0),
            ObligationCauseCode::TypeAlias(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f,
                    "TypeAlias", __self_0, __self_1, &__self_2),
            ObligationCauseCode::UnsizedNonPlaceExpr(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "UnsizedNonPlaceExpr", &__self_0),
            ObligationCauseCode::CompareEii {
                external_impl: __self_0, declaration: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "CompareEii", "external_impl", __self_0, "declaration",
                    &__self_1),
        }
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ObligationCauseCode<'tcx> {
    #[inline]
    fn eq(&self, other: &ObligationCauseCode<'tcx>) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (ObligationCauseCode::ArrayLen(__self_0),
                    ObligationCauseCode::ArrayLen(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::WhereClause(__self_0, __self_1),
                    ObligationCauseCode::WhereClause(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::OpaqueTypeBound(__self_0, __self_1),
                    ObligationCauseCode::OpaqueTypeBound(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::WhereClauseInExpr(__self_0, __self_1,
                    __self_2, __self_3),
                    ObligationCauseCode::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,
                (ObligationCauseCode::HostEffectInExpr(__self_0, __self_1,
                    __self_2, __self_3),
                    ObligationCauseCode::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,
                (ObligationCauseCode::ReferenceOutlivesReferent(__self_0),
                    ObligationCauseCode::ReferenceOutlivesReferent(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::ObjectTypeBound(__self_0, __self_1),
                    ObligationCauseCode::ObjectTypeBound(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::Coercion {
                    source: __self_0, target: __self_1 },
                    ObligationCauseCode::Coercion {
                    source: __arg1_0, target: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::VariableType(__self_0),
                    ObligationCauseCode::VariableType(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::SizedArgumentType(__self_0),
                    ObligationCauseCode::SizedArgumentType(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::SizedClosureCapture(__self_0),
                    ObligationCauseCode::SizedClosureCapture(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::SizedCoroutineInterior(__self_0),
                    ObligationCauseCode::SizedCoroutineInterior(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::RepeatElementCopy {
                    is_constable: __self_0, elt_span: __self_1 },
                    ObligationCauseCode::RepeatElementCopy {
                    is_constable: __arg1_0, elt_span: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::FieldSized {
                    adt_kind: __self_0, span: __self_1, last: __self_2 },
                    ObligationCauseCode::FieldSized {
                    adt_kind: __arg1_0, span: __arg1_1, last: __arg1_2 }) =>
                    __self_2 == __arg1_2 && __self_0 == __arg1_0 &&
                        __self_1 == __arg1_1,
                (ObligationCauseCode::BuiltinDerived(__self_0),
                    ObligationCauseCode::BuiltinDerived(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::ImplDerived(__self_0),
                    ObligationCauseCode::ImplDerived(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::WellFormedDerived(__self_0),
                    ObligationCauseCode::WellFormedDerived(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::ImplDerivedHost(__self_0),
                    ObligationCauseCode::ImplDerivedHost(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::BuiltinDerivedHost(__self_0),
                    ObligationCauseCode::BuiltinDerivedHost(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::FunctionArg {
                    arg_hir_id: __self_0,
                    call_hir_id: __self_1,
                    parent_code: __self_2 }, ObligationCauseCode::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,
                (ObligationCauseCode::CompareImplItem {
                    impl_item_def_id: __self_0,
                    trait_item_def_id: __self_1,
                    kind: __self_2 }, ObligationCauseCode::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,
                (ObligationCauseCode::CheckAssociatedTypeBounds {
                    impl_item_def_id: __self_0, trait_item_def_id: __self_1 },
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                    impl_item_def_id: __arg1_0, trait_item_def_id: __arg1_1 })
                    => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::MatchExpressionArm(__self_0),
                    ObligationCauseCode::MatchExpressionArm(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::Pattern {
                    span: __self_0, root_ty: __self_1, origin_expr: __self_2 },
                    ObligationCauseCode::Pattern {
                    span: __arg1_0, root_ty: __arg1_1, origin_expr: __arg1_2 })
                    =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (ObligationCauseCode::IfExpression {
                    expr_id: __self_0,
                    tail_defines_return_position_impl_trait: __self_1 },
                    ObligationCauseCode::IfExpression {
                    expr_id: __arg1_0,
                    tail_defines_return_position_impl_trait: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::LangFunctionType(__self_0),
                    ObligationCauseCode::LangFunctionType(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::ReturnValue(__self_0),
                    ObligationCauseCode::ReturnValue(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::OpaqueReturnType(__self_0),
                    ObligationCauseCode::OpaqueReturnType(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::BlockTailExpression(__self_0, __self_1),
                    ObligationCauseCode::BlockTailExpression(__arg1_0,
                    __arg1_1)) => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::AwaitableExpr(__self_0),
                    ObligationCauseCode::AwaitableExpr(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::WellFormed(__self_0),
                    ObligationCauseCode::WellFormed(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::MatchImpl(__self_0, __self_1),
                    ObligationCauseCode::MatchImpl(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (ObligationCauseCode::UnOp { hir_id: __self_0 },
                    ObligationCauseCode::UnOp { hir_id: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::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: __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,
                (ObligationCauseCode::AscribeUserTypeProvePredicate(__self_0),
                    ObligationCauseCode::AscribeUserTypeProvePredicate(__arg1_0))
                    => __self_0 == __arg1_0,
                (ObligationCauseCode::DynCompatible(__self_0),
                    ObligationCauseCode::DynCompatible(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::ConstParam(__self_0),
                    ObligationCauseCode::ConstParam(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::TypeAlias(__self_0, __self_1, __self_2),
                    ObligationCauseCode::TypeAlias(__arg1_0, __arg1_1,
                    __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (ObligationCauseCode::UnsizedNonPlaceExpr(__self_0),
                    ObligationCauseCode::UnsizedNonPlaceExpr(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ObligationCauseCode::CompareEii {
                    external_impl: __self_0, declaration: __self_1 },
                    ObligationCauseCode::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_receiver_is_total_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<Option<WellFormedLoc>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<Option<Ty<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ObligationCauseCode<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    ObligationCauseCode::Misc => {}
                    ObligationCauseCode::SliceOrArrayElem => {}
                    ObligationCauseCode::ArrayLen(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::TupleElem => {}
                    ObligationCauseCode::WhereClause(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::HostEffectInExpr(ref __binding_0,
                        ref __binding_1, ref __binding_2, ref __binding_3) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ObjectTypeBound(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::Coercion {
                        source: ref __binding_0, target: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::AssignmentLhsSized => {}
                    ObligationCauseCode::TupleInitializerSized => {}
                    ObligationCauseCode::StructInitializerSized => {}
                    ObligationCauseCode::VariableType(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedReturnType => {}
                    ObligationCauseCode::SizedCallReturnType => {}
                    ObligationCauseCode::SizedYieldType => {}
                    ObligationCauseCode::InlineAsmSized => {}
                    ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
                        {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::RepeatElementCopy {
                        is_constable: ref __binding_0, elt_span: ref __binding_1 }
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::FieldSized {
                        adt_kind: ref __binding_0,
                        span: ref __binding_1,
                        last: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::SizedConstOrStatic => {}
                    ObligationCauseCode::SharedStatic => {}
                    ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ImplDerived(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
                        {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::FunctionArg {
                        arg_hir_id: ref __binding_0,
                        call_hir_id: ref __binding_1,
                        parent_code: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::CompareImplItem {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1,
                        kind: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::CheckAssociatedTypeBounds {
                        impl_item_def_id: ref __binding_0,
                        trait_item_def_id: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ExprAssignable => {}
                    ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
                        {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::Pattern {
                        span: ref __binding_0,
                        root_ty: ref __binding_1,
                        origin_expr: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::IfExpression {
                        expr_id: ref __binding_0,
                        tail_defines_return_position_impl_trait: ref __binding_1 }
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::IfExpressionWithNoElse => {}
                    ObligationCauseCode::MainFunctionType => {}
                    ObligationCauseCode::LangFunctionType(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::IntrinsicType => {}
                    ObligationCauseCode::LetElse => {}
                    ObligationCauseCode::MethodReceiver => {}
                    ObligationCauseCode::ReturnNoExpression => {}
                    ObligationCauseCode::ReturnValue(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::BlockTailExpression(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::TrivialBound => {}
                    ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::ForLoopIterator => {}
                    ObligationCauseCode::QuestionMark => {}
                    ObligationCauseCode::WellFormed(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::MatchImpl(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
                        { __binding_0.hash_stable(__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.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                        { __binding_4.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::RustCall => {}
                    ObligationCauseCode::DynCompatible(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::AlwaysApplicableImpl => {}
                    ObligationCauseCode::ConstParam(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::TypeAlias(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                        {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ObligationCauseCode::CompareEii {
                        external_impl: ref __binding_0, declaration: ref __binding_1
                        } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, 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 => { 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 => { 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)
                            => {
                            56usize
                        }
                        ObligationCauseCode::RustCall => { 57usize }
                        ObligationCauseCode::DynCompatible(ref __binding_0) => {
                            58usize
                        }
                        ObligationCauseCode::AlwaysApplicableImpl => { 59usize }
                        ObligationCauseCode::ConstParam(ref __binding_0) => {
                            60usize
                        }
                        ObligationCauseCode::TypeAlias(ref __binding_0,
                            ref __binding_1, ref __binding_2) => {
                            61usize
                        }
                        ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
                            {
                            62usize
                        }
                        ObligationCauseCode::CompareEii {
                            external_impl: ref __binding_0, declaration: ref __binding_1
                            } => {
                            63usize
                        }
                    };
                ::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 => {}
                    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 => {}
                    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)
                        => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __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::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 }
                    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 }
                    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))
                    }
                    57usize => { ObligationCauseCode::RustCall }
                    58usize => {
                        ObligationCauseCode::DynCompatible(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    59usize => { ObligationCauseCode::AlwaysApplicableImpl }
                    60usize => {
                        ObligationCauseCode::ConstParam(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    61usize => {
                        ObligationCauseCode::TypeAlias(::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder),
                            ::rustc_serialize::Decodable::decode(__decoder))
                    }
                    62usize => {
                        ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    63usize => {
                        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..64, 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 => {}
                    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 => {}
                    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)
                        => {
                        {
                            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::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::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 => {
                            ObligationCauseCode::SizedCallReturnType
                        }
                        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 => {
                            ObligationCauseCode::ForLoopIterator
                        }
                        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)
                            => {
                            ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
                                        __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::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 => {
                        ObligationCauseCode::SizedCallReturnType
                    }
                    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 => {
                        ObligationCauseCode::ForLoopIterator
                    }
                    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)
                        => {
                        ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __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::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 predicate in the `predicates_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 `predicates_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,
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,
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(Option<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),
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    /// Obligations emitted during the normalization of a free type alias.
419    TypeAlias(ObligationCauseCodeHandle<'tcx>, Span, DefId),
420
421    /// Only reachable if the `unsized_fn_params` feature is used. Unsized function arguments must
422    /// be place expressions because we can't store them in MIR locals as temporaries.
423    UnsizedNonPlaceExpr(Span),
424
425    /// Error derived when checking an impl item is compatible with
426    /// its corresponding trait item's definition
427    CompareEii {
428        external_impl: LocalDefId,
429        declaration: DefId,
430    },
431}
432
433/// Whether a value can be extracted into a const.
434/// Used for diagnostics around array repeat expressions.
435#[derive(#[automatically_derived]
impl ::core::marker::Copy for IsConstable { }Copy, #[automatically_derived]
impl ::core::clone::Clone for IsConstable {
    #[inline]
    fn clone(&self) -> IsConstable { *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::cmp::PartialEq for IsConstable {
    #[inline]
    fn eq(&self, other: &IsConstable) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for IsConstable {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {}
}Eq, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for IsConstable {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    IsConstable::No => {}
                    IsConstable::Fn => {}
                    IsConstable::Ctor => {}
                }
            }
        }
    };HashStable, 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);
                match *self {
                    IsConstable::No => {}
                    IsConstable::Fn => {}
                    IsConstable::Ctor => {}
                }
            }
        }
    };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)]
436pub enum IsConstable {
437    No,
438    /// Call to a const fn
439    Fn,
440    /// Use of a const ctor
441    Ctor,
442}
443
444/// The 'location' at which we try to perform HIR-based wf checking.
445/// This information is used to obtain an `hir::Ty`, which
446/// we can walk in order to obtain precise spans for any
447/// 'nested' types (e.g. `Foo` in `Option<Foo>`).
448#[derive(#[automatically_derived]
impl ::core::marker::Copy for WellFormedLoc { }Copy, #[automatically_derived]
impl ::core::clone::Clone for WellFormedLoc {
    #[inline]
    fn clone(&self) -> WellFormedLoc {
        let _: ::core::clone::AssertParamIsClone<LocalDefId>;
        let _: ::core::clone::AssertParamIsClone<usize>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for WellFormedLoc {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            WellFormedLoc::Ty(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Ty",
                    &__self_0),
            WellFormedLoc::Param { function: __self_0, param_idx: __self_1 }
                =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f, "Param",
                    "function", __self_0, "param_idx", &__self_1),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for WellFormedLoc {
    #[inline]
    fn eq(&self, other: &WellFormedLoc) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (WellFormedLoc::Ty(__self_0), WellFormedLoc::Ty(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (WellFormedLoc::Param {
                    function: __self_0, param_idx: __self_1 },
                    WellFormedLoc::Param {
                    function: __arg1_0, param_idx: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for WellFormedLoc {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
        let _: ::core::cmp::AssertParamIsEq<usize>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for WellFormedLoc {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            WellFormedLoc::Ty(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            WellFormedLoc::Param { function: __self_0, param_idx: __self_1 }
                => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for WellFormedLoc {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    WellFormedLoc::Ty(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    WellFormedLoc::Param {
                        function: ref __binding_0, param_idx: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, 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
                        }
                    };
                ::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);
                    }
                }
            }
        }
    };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),
                        }
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `WellFormedLoc`, expected 0..2, actual {0}",
                                n));
                    }
                }
            }
        }
    };Decodable)]
449#[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);
                                }
                            }
                        }
                    }
                }
                <__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)?,
                            }
                        }
                    })
            }
            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),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
450pub enum WellFormedLoc {
451    /// Use the type of the provided definition.
452    Ty(LocalDefId),
453    /// Use the type of the parameter of the provided function.
454    /// We cannot use `hir::Param`, since the function may
455    /// not have a body (e.g. a trait method definition)
456    Param {
457        /// The function to lookup the parameter in
458        function: LocalDefId,
459        /// The index of the parameter to use.
460        /// Parameters are indexed from 0, with the return type
461        /// being the last 'parameter'
462        param_idx: usize,
463    },
464}
465
466impl<'tcx> ObligationCauseCode<'tcx> {
467    /// Returns the base obligation, ignoring derived obligations.
468    pub fn peel_derives(&self) -> &Self {
469        let mut base_cause = self;
470        while let Some(parent_code) = base_cause.parent() {
471            base_cause = parent_code;
472        }
473        base_cause
474    }
475
476    pub fn parent(&self) -> Option<&Self> {
477        match self {
478            ObligationCauseCode::FunctionArg { parent_code, .. } => Some(parent_code),
479            ObligationCauseCode::BuiltinDerived(derived)
480            | ObligationCauseCode::WellFormedDerived(derived)
481            | ObligationCauseCode::ImplDerived(box ImplDerivedCause { derived, .. }) => {
482                Some(&derived.parent_code)
483            }
484            ObligationCauseCode::BuiltinDerivedHost(derived)
485            | ObligationCauseCode::ImplDerivedHost(box ImplDerivedHostCause { derived, .. }) => {
486                Some(&derived.parent_code)
487            }
488            _ => None,
489        }
490    }
491
492    /// Returns the base obligation and the base trait predicate, if any, ignoring
493    /// derived obligations.
494    pub fn peel_derives_with_predicate(&self) -> (&Self, Option<ty::PolyTraitPredicate<'tcx>>) {
495        let mut base_cause = self;
496        let mut base_trait_pred = None;
497        while let Some((parent_code, parent_pred)) = base_cause.parent_with_predicate() {
498            base_cause = parent_code;
499            if let Some(parent_pred) = parent_pred {
500                base_trait_pred = Some(parent_pred);
501            }
502        }
503
504        (base_cause, base_trait_pred)
505    }
506
507    pub fn parent_with_predicate(&self) -> Option<(&Self, Option<ty::PolyTraitPredicate<'tcx>>)> {
508        match self {
509            ObligationCauseCode::FunctionArg { parent_code, .. } => Some((parent_code, None)),
510            ObligationCauseCode::BuiltinDerived(derived)
511            | ObligationCauseCode::WellFormedDerived(derived)
512            | ObligationCauseCode::ImplDerived(box ImplDerivedCause { derived, .. }) => {
513                Some((&derived.parent_code, Some(derived.parent_trait_pred)))
514            }
515            _ => None,
516        }
517    }
518
519    pub fn peel_match_impls(&self) -> &Self {
520        match self {
521            ObligationCauseCode::MatchImpl(cause, _) => cause.code(),
522            _ => self,
523        }
524    }
525}
526
527// `ObligationCauseCode` is used a lot. Make sure it doesn't unintentionally get bigger.
528#[cfg(target_pointer_width = "64")]
529const _: [(); 48] = [(); ::std::mem::size_of::<ObligationCauseCode<'_>>()];rustc_data_structures::static_assert_size!(ObligationCauseCode<'_>, 48);
530
531#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for MatchExpressionArmCause<'tcx> {
    #[inline]
    fn clone(&self) -> MatchExpressionArmCause<'tcx> {
        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 _ =
            &["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,
            "MatchExpressionArmCause", names, values)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for MatchExpressionArmCause<'tcx> {
    #[inline]
    fn eq(&self, other: &MatchExpressionArmCause<'tcx>) -> 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_receiver_is_total_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, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for MatchExpressionArmCause<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::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.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                        { __binding_4.hash_stable(__hcx, __hasher); }
                        { __binding_5.hash_stable(__hcx, __hasher); }
                        { __binding_6.hash_stable(__hcx, __hasher); }
                        { __binding_7.hash_stable(__hcx, __hasher); }
                        { __binding_8.hash_stable(__hcx, __hasher); }
                        { __binding_9.hash_stable(__hcx, __hasher); }
                        { __binding_10.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for
            MatchExpressionArmCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                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 }
                        => {
                        ::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)]
532#[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)]
533pub struct MatchExpressionArmCause<'tcx> {
534    pub arm_block_id: Option<HirId>,
535    pub arm_ty: Ty<'tcx>,
536    pub arm_span: Span,
537    pub prior_arm_block_id: Option<HirId>,
538    pub prior_arm_ty: Ty<'tcx>,
539    pub prior_arm_span: Span,
540    /// Span of the scrutinee of the match (the matched value).
541    pub scrut_span: Span,
542    /// Source of the match, i.e. `match` or a desugaring.
543    pub source: hir::MatchSource,
544    /// Span of the *whole* match expr.
545    pub expr_span: Span,
546    /// Spans of the previous arms except for those that diverge (i.e. evaluate to `!`).
547    ///
548    /// These are used for pointing out errors that may affect several arms.
549    pub prior_non_diverging_arms: Vec<Span>,
550    /// Is the expectation of this match expression an RPIT?
551    pub tail_defines_return_position_impl_trait: Option<LocalDefId>,
552}
553
554/// Information about the origin expression of a pattern, relevant to diagnostics.
555/// Fields here refer to the scrutinee of a pattern.
556/// If the scrutinee isn't given in the diagnostic, then this won't exist.
557#[derive(#[automatically_derived]
impl ::core::marker::Copy for PatternOriginExpr { }Copy, #[automatically_derived]
impl ::core::clone::Clone for PatternOriginExpr {
    #[inline]
    fn clone(&self) -> PatternOriginExpr {
        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", &self.peeled_span,
            "peeled_count", &self.peeled_count,
            "peeled_prefix_suggestion_parentheses",
            &&self.peeled_prefix_suggestion_parentheses)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for PatternOriginExpr {
    #[inline]
    fn eq(&self, other: &PatternOriginExpr) -> 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_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Span>;
        let _: ::core::cmp::AssertParamIsEq<usize>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
    }
}Eq)]
558#[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<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for PatternOriginExpr {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    PatternOriginExpr {
                        peeled_span: ref __binding_0,
                        peeled_count: ref __binding_1,
                        peeled_prefix_suggestion_parentheses: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for PatternOriginExpr {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    PatternOriginExpr {
                        peeled_span: ref __binding_0,
                        peeled_count: ref __binding_1,
                        peeled_prefix_suggestion_parentheses: 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);
                    }
                }
            }
        }
    };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)]
559pub struct PatternOriginExpr {
560    /// A span representing the scrutinee expression, with all leading references
561    /// peeled from the expression.
562    /// Only references in the expression are peeled - if the expression refers to a variable
563    /// whose type is a reference, then that reference is kept because it wasn't created
564    /// in the expression.
565    pub peeled_span: Span,
566    /// The number of references that were peeled to produce `peeled_span`.
567    pub peeled_count: usize,
568    /// Does the peeled expression need to be wrapped in parentheses for
569    /// a prefix suggestion (i.e., dereference) to be valid.
570    pub peeled_prefix_suggestion_parentheses: bool,
571}
572
573#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for DerivedCause<'tcx> {
    #[inline]
    fn clone(&self) -> DerivedCause<'tcx> {
        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", &self.parent_trait_pred, "parent_code",
            &&self.parent_code)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for DerivedCause<'tcx> {
    #[inline]
    fn eq(&self, other: &DerivedCause<'tcx>) -> 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_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<ty::PolyTraitPredicate<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for DerivedCause<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    DerivedCause {
                        parent_trait_pred: ref __binding_0,
                        parent_code: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for DerivedCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    DerivedCause {
                        parent_trait_pred: ref __binding_0,
                        parent_code: 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 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)]
574#[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)]
575pub struct DerivedCause<'tcx> {
576    /// The trait predicate of the parent obligation that led to the
577    /// current obligation. Note that only trait obligations lead to
578    /// derived obligations, so we just store the trait predicate here
579    /// directly.
580    pub parent_trait_pred: ty::PolyTraitPredicate<'tcx>,
581
582    /// The parent trait had this cause.
583    pub parent_code: ObligationCauseCodeHandle<'tcx>,
584}
585
586#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for ImplDerivedCause<'tcx> {
    #[inline]
    fn clone(&self) -> ImplDerivedCause<'tcx> {
        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_predicate_index: ::core::clone::Clone::clone(&self.impl_def_predicate_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", &self.derived,
            "impl_or_alias_def_id", &self.impl_or_alias_def_id,
            "impl_def_predicate_index", &self.impl_def_predicate_index,
            "span", &&self.span)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ImplDerivedCause<'tcx> {
    #[inline]
    fn eq(&self, other: &ImplDerivedCause<'tcx>) -> bool {
        self.derived == other.derived &&
                    self.impl_or_alias_def_id == other.impl_or_alias_def_id &&
                self.impl_def_predicate_index ==
                    other.impl_def_predicate_index && self.span == other.span
    }
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for ImplDerivedCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_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, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ImplDerivedCause<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    ImplDerivedCause {
                        derived: ref __binding_0,
                        impl_or_alias_def_id: ref __binding_1,
                        impl_def_predicate_index: ref __binding_2,
                        span: ref __binding_3 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ImplDerivedCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    ImplDerivedCause {
                        derived: ref __binding_0,
                        impl_or_alias_def_id: ref __binding_1,
                        impl_def_predicate_index: ref __binding_2,
                        span: 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);
                    }
                }
            }
        }
    };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_predicate_index: ::rustc_serialize::Decodable::decode(__decoder),
                    span: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
587#[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_predicate_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_predicate_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_predicate_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_predicate_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_predicate_index: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
                                __folder),
                            span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
588pub struct ImplDerivedCause<'tcx> {
589    pub derived: DerivedCause<'tcx>,
590    /// The `DefId` of the `impl` that gave rise to the `derived` obligation.
591    /// If the `derived` obligation arose from a trait alias, which conceptually has a synthetic
592    /// impl, then this will be the `DefId` of that trait alias. Care should therefore be taken to
593    /// handle that exceptional case where appropriate.
594    pub impl_or_alias_def_id: DefId,
595    /// The index of the derived predicate in the parent impl's predicates.
596    pub impl_def_predicate_index: Option<usize>,
597    pub span: Span,
598}
599
600#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for DerivedHostCause<'tcx> {
    #[inline]
    fn clone(&self) -> DerivedHostCause<'tcx> {
        DerivedHostCause {
            parent_host_pred: ::core::clone::Clone::clone(&self.parent_host_pred),
            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_pred", &self.parent_host_pred,
            "parent_code", &&self.parent_code)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for DerivedHostCause<'tcx> {
    #[inline]
    fn eq(&self, other: &DerivedHostCause<'tcx>) -> bool {
        self.parent_host_pred == other.parent_host_pred &&
            self.parent_code == other.parent_code
    }
}PartialEq, #[automatically_derived]
impl<'tcx> ::core::cmp::Eq for DerivedHostCause<'tcx> {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<ty::Binder<'tcx,
                ty::HostEffectPredicate<'tcx>>>;
        let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
    }
}Eq, const _: () =
    {
        impl<'tcx, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for DerivedHostCause<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    DerivedHostCause {
                        parent_host_pred: ref __binding_0,
                        parent_code: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for DerivedHostCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    DerivedHostCause {
                        parent_host_pred: ref __binding_0,
                        parent_code: 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 DerivedHostCause<'tcx> {
            fn decode(__decoder: &mut __D) -> Self {
                DerivedHostCause {
                    parent_host_pred: ::rustc_serialize::Decodable::decode(__decoder),
                    parent_code: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable)]
601#[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_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 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_pred: __binding_0, parent_code: __binding_1 } =>
                            {
                            DerivedHostCause {
                                parent_host_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 {
                    DerivedHostCause {
                        parent_host_pred: __binding_0, parent_code: __binding_1 } =>
                        {
                        DerivedHostCause {
                            parent_host_pred: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
                                __folder),
                            parent_code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
                                __folder),
                        }
                    }
                }
            }
        }
    };TypeFoldable)]
602pub struct DerivedHostCause<'tcx> {
603    /// The trait predicate of the parent obligation that led to the
604    /// current obligation. Note that only trait obligations lead to
605    /// derived obligations, so we just store the trait predicate here
606    /// directly.
607    pub parent_host_pred: ty::Binder<'tcx, ty::HostEffectPredicate<'tcx>>,
608
609    /// The parent trait had this cause.
610    pub parent_code: ObligationCauseCodeHandle<'tcx>,
611}
612
613#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for ImplDerivedHostCause<'tcx> {
    #[inline]
    fn clone(&self) -> ImplDerivedHostCause<'tcx> {
        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", &self.derived, "impl_def_id",
            &self.impl_def_id, "span", &&self.span)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for ImplDerivedHostCause<'tcx> {
    #[inline]
    fn eq(&self, other: &ImplDerivedHostCause<'tcx>) -> 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_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<DerivedHostCause<'tcx>>;
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
    }
}Eq, const _: () =
    {
        impl<'tcx, '__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ImplDerivedHostCause<'tcx> {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    ImplDerivedHostCause {
                        derived: ref __binding_0,
                        impl_def_id: ref __binding_1,
                        span: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for ImplDerivedHostCause<'tcx> {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    ImplDerivedHostCause {
                        derived: ref __binding_0,
                        impl_def_id: ref __binding_1,
                        span: 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);
                    }
                }
            }
        }
    };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)]
614#[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)]
615pub struct ImplDerivedHostCause<'tcx> {
616    pub derived: DerivedHostCause<'tcx>,
617    /// The `DefId` of the `impl` that gave rise to the `derived` obligation.
618    pub impl_def_id: DefId,
619    pub span: Span,
620}
621
622#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for SelectionError<'tcx> {
    #[inline]
    fn clone(&self) -> SelectionError<'tcx> {
        match self {
            SelectionError::Unimplemented => SelectionError::Unimplemented,
            SelectionError::SignatureMismatch(__self_0) =>
                SelectionError::SignatureMismatch(::core::clone::Clone::clone(__self_0)),
            SelectionError::TraitDynIncompatible(__self_0) =>
                SelectionError::TraitDynIncompatible(::core::clone::Clone::clone(__self_0)),
            SelectionError::NotConstEvaluatable(__self_0) =>
                SelectionError::NotConstEvaluatable(::core::clone::Clone::clone(__self_0)),
            SelectionError::Overflow(__self_0) =>
                SelectionError::Overflow(::core::clone::Clone::clone(__self_0)),
            SelectionError::OpaqueTypeAutoTraitLeakageUnknown(__self_0) =>
                SelectionError::OpaqueTypeAutoTraitLeakageUnknown(::core::clone::Clone::clone(__self_0)),
            SelectionError::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 {
            SelectionError::Unimplemented =>
                ::core::fmt::Formatter::write_str(f, "Unimplemented"),
            SelectionError::SignatureMismatch(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SignatureMismatch", &__self_0),
            SelectionError::TraitDynIncompatible(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "TraitDynIncompatible", &__self_0),
            SelectionError::NotConstEvaluatable(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "NotConstEvaluatable", &__self_0),
            SelectionError::Overflow(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "Overflow", &__self_0),
            SelectionError::OpaqueTypeAutoTraitLeakageUnknown(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "OpaqueTypeAutoTraitLeakageUnknown", &__self_0),
            SelectionError::ConstArgHasWrongType {
                ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "ConstArgHasWrongType", "ct", __self_0, "ct_ty", __self_1,
                    "expected_ty", &__self_2),
        }
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for SelectionError<'tcx> {
    #[inline]
    fn eq(&self, other: &SelectionError<'tcx>) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (SelectionError::SignatureMismatch(__self_0),
                    SelectionError::SignatureMismatch(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (SelectionError::TraitDynIncompatible(__self_0),
                    SelectionError::TraitDynIncompatible(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (SelectionError::NotConstEvaluatable(__self_0),
                    SelectionError::NotConstEvaluatable(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (SelectionError::Overflow(__self_0),
                    SelectionError::Overflow(__arg1_0)) => __self_0 == __arg1_0,
                (SelectionError::OpaqueTypeAutoTraitLeakageUnknown(__self_0),
                    SelectionError::OpaqueTypeAutoTraitLeakageUnknown(__arg1_0))
                    => __self_0 == __arg1_0,
                (SelectionError::ConstArgHasWrongType {
                    ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 },
                    SelectionError::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_receiver_is_total_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::OpaqueTypeAutoTraitLeakageUnknown(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)]
623pub enum SelectionError<'tcx> {
624    /// The trait is not implemented.
625    Unimplemented,
626    /// After a closure impl has selected, its "outputs" were evaluated
627    /// (which for closures includes the "input" type params) and they
628    /// didn't resolve. See `confirm_poly_trait_refs` for more.
629    SignatureMismatch(Box<SignatureMismatchData<'tcx>>),
630    /// The trait pointed by `DefId` is dyn-incompatible.
631    TraitDynIncompatible(DefId),
632    /// A given constant couldn't be evaluated.
633    NotConstEvaluatable(NotConstEvaluatable),
634    /// Exceeded the recursion depth during type projection.
635    Overflow(OverflowError),
636    /// Computing an opaque type's hidden type caused an error (e.g. a cycle error).
637    /// We can thus not know whether the hidden type implements an auto trait, so
638    /// we should not presume anything about it.
639    OpaqueTypeAutoTraitLeakageUnknown(DefId),
640    /// Error for a `ConstArgHasType` goal
641    ConstArgHasWrongType { ct: ty::Const<'tcx>, ct_ty: Ty<'tcx>, expected_ty: Ty<'tcx> },
642}
643
644#[derive(#[automatically_derived]
impl<'tcx> ::core::clone::Clone for SignatureMismatchData<'tcx> {
    #[inline]
    fn clone(&self) -> SignatureMismatchData<'tcx> {
        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", &self.found_trait_ref,
            "expected_trait_ref", &self.expected_trait_ref, "terr",
            &&self.terr)
    }
}Debug, #[automatically_derived]
impl<'tcx> ::core::cmp::PartialEq for SignatureMismatchData<'tcx> {
    #[inline]
    fn eq(&self, other: &SignatureMismatchData<'tcx>) -> 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_receiver_is_total_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)]
645pub struct SignatureMismatchData<'tcx> {
646    pub found_trait_ref: ty::TraitRef<'tcx>,
647    pub expected_trait_ref: ty::TraitRef<'tcx>,
648    pub terr: ty::error::TypeError<'tcx>,
649}
650
651/// When performing resolution, it is typically the case that there
652/// can be one of three outcomes:
653///
654/// - `Ok(Some(r))`: success occurred with result `r`
655/// - `Ok(None)`: could not definitely determine anything, usually due
656///   to inconclusive type inference.
657/// - `Err(e)`: error `e` occurred
658pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
659
660/// Given the successful resolution of an obligation, the `ImplSource`
661/// indicates where the impl comes from.
662///
663/// For example, the obligation may be satisfied by a specific impl (case A),
664/// or it may be relative to some bound that is in scope (case B).
665///
666/// ```ignore (illustrative)
667/// impl<T:Clone> Clone<T> for Option<T> { ... } // Impl_1
668/// impl<T:Clone> Clone<T> for Box<T> { ... }    // Impl_2
669/// impl Clone for i32 { ... }                   // Impl_3
670///
671/// fn foo<T: Clone>(concrete: Option<Box<i32>>, param: T, mixed: Option<T>) {
672///     // Case A: ImplSource points at a specific impl. Only possible when
673///     // type is concretely known. If the impl itself has bounded
674///     // type parameters, ImplSource will carry resolutions for those as well:
675///     concrete.clone(); // ImplSource(Impl_1, [ImplSource(Impl_2, [ImplSource(Impl_3)])])
676///
677///     // Case B: ImplSource must be provided by caller. This applies when
678///     // type is a type parameter.
679///     param.clone();    // ImplSource::Param
680///
681///     // Case C: A mix of cases A and B.
682///     mixed.clone();    // ImplSource(Impl_1, [ImplSource::Param])
683/// }
684/// ```
685///
686/// ### The type parameter `N`
687///
688/// See explanation on `ImplSourceUserDefinedData`.
689#[derive(#[automatically_derived]
impl<'tcx, N: ::core::clone::Clone> ::core::clone::Clone for
    ImplSource<'tcx, N> {
    #[inline]
    fn clone(&self) -> ImplSource<'tcx, N> {
        match self {
            ImplSource::UserDefined(__self_0) =>
                ImplSource::UserDefined(::core::clone::Clone::clone(__self_0)),
            ImplSource::Param(__self_0) =>
                ImplSource::Param(::core::clone::Clone::clone(__self_0)),
            ImplSource::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::cmp::PartialEq for
    ImplSource<'tcx, N> {
    #[inline]
    fn eq(&self, other: &ImplSource<'tcx, N>) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (ImplSource::UserDefined(__self_0),
                    ImplSource::UserDefined(__arg1_0)) => __self_0 == __arg1_0,
                (ImplSource::Param(__self_0), ImplSource::Param(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (ImplSource::Builtin(__self_0, __self_1),
                    ImplSource::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_receiver_is_total_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, '__ctx, N>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ImplSource<'tcx, N> where
            N: ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    ImplSource::UserDefined(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ImplSource::Param(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
690#[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)]
691pub enum ImplSource<'tcx, N> {
692    /// ImplSource identifying a particular impl.
693    UserDefined(ImplSourceUserDefinedData<'tcx, N>),
694
695    /// Successful resolution to an obligation provided by the caller
696    /// for some type parameter. The `Vec<N>` represents the
697    /// obligations incurred from normalizing the where-clause (if
698    /// any).
699    Param(ThinVec<N>),
700
701    /// Successful resolution for a builtin impl.
702    Builtin(BuiltinImplSource, ThinVec<N>),
703}
704
705impl<'tcx, N> ImplSource<'tcx, N> {
706    pub fn nested_obligations(self) -> ThinVec<N> {
707        match self {
708            ImplSource::UserDefined(i) => i.nested,
709            ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
710        }
711    }
712
713    pub fn borrow_nested_obligations(&self) -> &[N] {
714        match self {
715            ImplSource::UserDefined(i) => &i.nested,
716            ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
717        }
718    }
719
720    pub fn borrow_nested_obligations_mut(&mut self) -> &mut [N] {
721        match self {
722            ImplSource::UserDefined(i) => &mut i.nested,
723            ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
724        }
725    }
726
727    pub fn map<M, F>(self, f: F) -> ImplSource<'tcx, M>
728    where
729        F: FnMut(N) -> M,
730    {
731        match self {
732            ImplSource::UserDefined(i) => ImplSource::UserDefined(ImplSourceUserDefinedData {
733                impl_def_id: i.impl_def_id,
734                args: i.args,
735                nested: i.nested.into_iter().map(f).collect(),
736            }),
737            ImplSource::Param(n) => ImplSource::Param(n.into_iter().map(f).collect()),
738            ImplSource::Builtin(source, n) => {
739                ImplSource::Builtin(source, n.into_iter().map(f).collect())
740            }
741        }
742    }
743}
744
745/// Identifies a particular impl in the source, along with a set of
746/// generic parameters from the impl's type/lifetime parameters. The
747/// `nested` vector corresponds to the nested obligations attached to
748/// the impl's type parameters.
749///
750/// The type parameter `N` indicates the type used for "nested
751/// obligations" that are required by the impl. During type-check, this
752/// is `Obligation`, as one might expect. During codegen, however, this
753/// is `()`, because codegen only requires a shallow resolution of an
754/// impl, and nested obligations are satisfied later.
755#[derive(#[automatically_derived]
impl<'tcx, N: ::core::clone::Clone> ::core::clone::Clone for
    ImplSourceUserDefinedData<'tcx, N> {
    #[inline]
    fn clone(&self) -> ImplSourceUserDefinedData<'tcx, N> {
        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::cmp::PartialEq for
    ImplSourceUserDefinedData<'tcx, N> {
    #[inline]
    fn eq(&self, other: &ImplSourceUserDefinedData<'tcx, N>) -> 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_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<DefId>;
        let _: ::core::cmp::AssertParamIsEq<GenericArgsRef<'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) {
                match *self {
                    ImplSourceUserDefinedData {
                        impl_def_id: ref __binding_0,
                        args: ref __binding_1,
                        nested: 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);
                    }
                }
            }
        }
    };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, '__ctx, N>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for ImplSourceUserDefinedData<'tcx, N> where
            N: ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    ImplSourceUserDefinedData {
                        impl_def_id: ref __binding_0,
                        args: ref __binding_1,
                        nested: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
756#[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)]
757pub struct ImplSourceUserDefinedData<'tcx, N> {
758    pub impl_def_id: DefId,
759    pub args: GenericArgsRef<'tcx>,
760    pub nested: ThinVec<N>,
761}
762
763#[derive(#[automatically_derived]
impl ::core::clone::Clone for DynCompatibilityViolation {
    #[inline]
    fn clone(&self) -> DynCompatibilityViolation {
        match self {
            DynCompatibilityViolation::ExplicitlyDynIncompatible(__self_0) =>
                DynCompatibilityViolation::ExplicitlyDynIncompatible(::core::clone::Clone::clone(__self_0)),
            DynCompatibilityViolation::SizedSelf(__self_0) =>
                DynCompatibilityViolation::SizedSelf(::core::clone::Clone::clone(__self_0)),
            DynCompatibilityViolation::SupertraitSelf(__self_0) =>
                DynCompatibilityViolation::SupertraitSelf(::core::clone::Clone::clone(__self_0)),
            DynCompatibilityViolation::SupertraitNonLifetimeBinder(__self_0)
                =>
                DynCompatibilityViolation::SupertraitNonLifetimeBinder(::core::clone::Clone::clone(__self_0)),
            DynCompatibilityViolation::SupertraitConst(__self_0) =>
                DynCompatibilityViolation::SupertraitConst(::core::clone::Clone::clone(__self_0)),
            DynCompatibilityViolation::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)),
            DynCompatibilityViolation::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)),
            DynCompatibilityViolation::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 {
            DynCompatibilityViolation::ExplicitlyDynIncompatible(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ExplicitlyDynIncompatible", &__self_0),
            DynCompatibilityViolation::SizedSelf(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SizedSelf", &__self_0),
            DynCompatibilityViolation::SupertraitSelf(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SupertraitSelf", &__self_0),
            DynCompatibilityViolation::SupertraitNonLifetimeBinder(__self_0)
                =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SupertraitNonLifetimeBinder", &__self_0),
            DynCompatibilityViolation::SupertraitConst(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SupertraitConst", &__self_0),
            DynCompatibilityViolation::Method(__self_0, __self_1, __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f, "Method",
                    __self_0, __self_1, &__self_2),
            DynCompatibilityViolation::AssocConst(__self_0, __self_1,
                __self_2) =>
                ::core::fmt::Formatter::debug_tuple_field3_finish(f,
                    "AssocConst", __self_0, __self_1, &__self_2),
            DynCompatibilityViolation::GenericAssocTy(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "GenericAssocTy", __self_0, &__self_1),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for DynCompatibilityViolation {
    #[inline]
    fn eq(&self, other: &DynCompatibilityViolation) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (DynCompatibilityViolation::ExplicitlyDynIncompatible(__self_0),
                    DynCompatibilityViolation::ExplicitlyDynIncompatible(__arg1_0))
                    => __self_0 == __arg1_0,
                (DynCompatibilityViolation::SizedSelf(__self_0),
                    DynCompatibilityViolation::SizedSelf(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DynCompatibilityViolation::SupertraitSelf(__self_0),
                    DynCompatibilityViolation::SupertraitSelf(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DynCompatibilityViolation::SupertraitNonLifetimeBinder(__self_0),
                    DynCompatibilityViolation::SupertraitNonLifetimeBinder(__arg1_0))
                    => __self_0 == __arg1_0,
                (DynCompatibilityViolation::SupertraitConst(__self_0),
                    DynCompatibilityViolation::SupertraitConst(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (DynCompatibilityViolation::Method(__self_0, __self_1,
                    __self_2),
                    DynCompatibilityViolation::Method(__arg1_0, __arg1_1,
                    __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (DynCompatibilityViolation::AssocConst(__self_0, __self_1,
                    __self_2),
                    DynCompatibilityViolation::AssocConst(__arg1_0, __arg1_1,
                    __arg1_2)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1 &&
                        __self_2 == __arg1_2,
                (DynCompatibilityViolation::GenericAssocTy(__self_0,
                    __self_1),
                    DynCompatibilityViolation::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_receiver_is_total_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) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            DynCompatibilityViolation::ExplicitlyDynIncompatible(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DynCompatibilityViolation::SizedSelf(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DynCompatibilityViolation::SupertraitSelf(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DynCompatibilityViolation::SupertraitNonLifetimeBinder(__self_0)
                => ::core::hash::Hash::hash(__self_0, state),
            DynCompatibilityViolation::SupertraitConst(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            DynCompatibilityViolation::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)
            }
            DynCompatibilityViolation::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)
            }
            DynCompatibilityViolation::GenericAssocTy(__self_0, __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for DynCompatibilityViolation {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    DynCompatibilityViolation::ExplicitlyDynIncompatible(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SizedSelf(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SupertraitSelf(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SupertraitNonLifetimeBinder(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::SupertraitConst(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::Method(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::AssocConst(ref __binding_0,
                        ref __binding_1, ref __binding_2) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                    DynCompatibilityViolation::GenericAssocTy(ref __binding_0,
                        ref __binding_1) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
764pub enum DynCompatibilityViolation {
765    /// Trait is marked `#[rustc_dyn_incompatible_trait]`.
766    ExplicitlyDynIncompatible(SmallVec<[Span; 1]>),
767
768    /// `Self: Sized` declared on the trait.
769    SizedSelf(SmallVec<[Span; 1]>),
770
771    /// Supertrait reference references `Self` an in illegal location
772    /// (e.g., `trait Foo : Bar<Self>`).
773    SupertraitSelf(SmallVec<[Span; 1]>),
774
775    // Supertrait has a non-lifetime `for<T>` binder.
776    SupertraitNonLifetimeBinder(SmallVec<[Span; 1]>),
777
778    // Trait has a `const Trait` supertrait.
779    SupertraitConst(SmallVec<[Span; 1]>),
780
781    /// Method has something illegal.
782    Method(Symbol, MethodViolation, Span),
783
784    /// Associated constant is faulty.
785    AssocConst(Symbol, AssocConstViolation, Span),
786
787    /// Generic associated type (GAT).
788    GenericAssocTy(Symbol, Span),
789}
790
791impl DynCompatibilityViolation {
792    pub fn error_msg(&self) -> Cow<'static, str> {
793        // FIXME(mgca): For method violations we just say "method ..." but for assoc const ones we
794        //              say "it contains ... associated constant ...". Make it consistent.
795
796        match self {
797            Self::ExplicitlyDynIncompatible(_) => "it opted out of dyn-compatibility".into(),
798            Self::SizedSelf(_) => "it requires `Self: Sized`".into(),
799            Self::SupertraitSelf(spans) => {
800                if spans.iter().any(|sp| *sp != DUMMY_SP) {
801                    "it uses `Self` as a type parameter".into()
802                } else {
803                    "it cannot use `Self` as a type parameter in a supertrait or `where`-clause"
804                        .into()
805                }
806            }
807            Self::SupertraitNonLifetimeBinder(_) => {
808                "where clause cannot reference non-lifetime `for<...>` variables".into()
809            }
810            Self::SupertraitConst(_) => "it cannot have a `const` supertrait".into(),
811            Self::Method(name, MethodViolation::StaticMethod(_), _) => {
812                ::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()
813            }
814            Self::Method(name, MethodViolation::ReferencesSelfInput(_), DUMMY_SP) => {
815                ::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()
816            }
817            Self::Method(name, MethodViolation::ReferencesSelfInput(_), _) => {
818                ::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()
819            }
820            Self::Method(name, MethodViolation::ReferencesSelfOutput, _) => {
821                ::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()
822            }
823            Self::Method(name, MethodViolation::ReferencesImplTraitInTrait(_), _) => {
824                ::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()
825            }
826            Self::Method(name, MethodViolation::AsyncFn, _) => {
827                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` is `async`", name))
    })format!("method `{name}` is `async`").into()
828            }
829            Self::Method(name, MethodViolation::CVariadic, _) => {
830                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` is C-variadic", name))
    })format!("method `{name}` is C-variadic").into()
831            }
832            Self::Method(name, MethodViolation::WhereClauseReferencesSelf, _) => {
833                ::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()
834            }
835            Self::Method(name, MethodViolation::Generic, _) => {
836                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("method `{0}` has generic type parameters",
                name))
    })format!("method `{name}` has generic type parameters").into()
837            }
838            Self::Method(name, MethodViolation::UndispatchableReceiver(_), _) => {
839                ::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()
840            }
841            Self::AssocConst(name, AssocConstViolation::FeatureNotEnabled, _) => {
842                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains associated const `{0}`",
                name))
    })format!("it contains associated const `{name}`").into()
843            }
844            Self::AssocConst(name, AssocConstViolation::Generic, _) => {
845                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains generic associated const `{0}`",
                name))
    })format!("it contains generic associated const `{name}`").into()
846            }
847            Self::AssocConst(name, AssocConstViolation::NonType, _) => {
848                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains associated const `{0}` that\'s not defined as `type const`",
                name))
    })format!("it contains associated const `{name}` that's not defined as `type const`")
849                    .into()
850            }
851            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!(
852                "it contains associated const `{name}` whose type references the `Self` type"
853            )
854            .into(),
855            Self::GenericAssocTy(name, _) => {
856                ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("it contains generic associated type `{0}`",
                name))
    })format!("it contains generic associated type `{name}`").into()
857            }
858        }
859    }
860
861    pub fn solution(&self) -> DynCompatibilityViolationSolution {
862        match self {
863            Self::ExplicitlyDynIncompatible(_)
864            | Self::SizedSelf(_)
865            | Self::SupertraitSelf(_)
866            | Self::SupertraitNonLifetimeBinder(..)
867            | Self::SupertraitConst(_) => DynCompatibilityViolationSolution::None,
868            Self::Method(
869                name,
870                MethodViolation::StaticMethod(Some((add_self_sugg, make_sized_sugg))),
871                _,
872            ) => DynCompatibilityViolationSolution::AddSelfOrMakeSized {
873                name: *name,
874                add_self_sugg: add_self_sugg.clone(),
875                make_sized_sugg: make_sized_sugg.clone(),
876            },
877            Self::Method(name, MethodViolation::UndispatchableReceiver(Some(span)), _) => {
878                DynCompatibilityViolationSolution::ChangeToRefSelf(*name, *span)
879            }
880            Self::Method(name, ..) | Self::AssocConst(name, ..) | Self::GenericAssocTy(name, _) => {
881                DynCompatibilityViolationSolution::MoveToAnotherTrait(*name)
882            }
883        }
884    }
885
886    pub fn spans(&self) -> SmallVec<[Span; 1]> {
887        // When `span` comes from a separate crate, it'll be `DUMMY_SP`. Treat it as `None` so
888        // diagnostics use a `note` instead of a `span_label`.
889        match self {
890            Self::ExplicitlyDynIncompatible(spans)
891            | Self::SizedSelf(spans)
892            | Self::SupertraitSelf(spans)
893            | Self::SupertraitNonLifetimeBinder(spans)
894            | Self::SupertraitConst(spans) => spans.clone(),
895            Self::Method(_, _, span)
896            | Self::AssocConst(_, _, span)
897            | Self::GenericAssocTy(_, span) => {
898                if *span != DUMMY_SP {
899                    {
    let count = 0usize + 1usize;
    let mut vec = ::smallvec::SmallVec::new();
    if count <= vec.inline_size() {
        vec.push(*span);
        vec
    } else {
        ::smallvec::SmallVec::from_vec(<[_]>::into_vec(::alloc::boxed::box_new([*span])))
    }
}smallvec![*span]
900                } else {
901                    ::smallvec::SmallVec::new()smallvec![]
902                }
903            }
904        }
905    }
906}
907
908#[derive(#[automatically_derived]
impl ::core::clone::Clone for DynCompatibilityViolationSolution {
    #[inline]
    fn clone(&self) -> DynCompatibilityViolationSolution {
        match self {
            DynCompatibilityViolationSolution::None =>
                DynCompatibilityViolationSolution::None,
            DynCompatibilityViolationSolution::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),
                },
            DynCompatibilityViolationSolution::ChangeToRefSelf(__self_0,
                __self_1) =>
                DynCompatibilityViolationSolution::ChangeToRefSelf(::core::clone::Clone::clone(__self_0),
                    ::core::clone::Clone::clone(__self_1)),
            DynCompatibilityViolationSolution::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 {
            DynCompatibilityViolationSolution::None =>
                ::core::fmt::Formatter::write_str(f, "None"),
            DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                name: __self_0,
                add_self_sugg: __self_1,
                make_sized_sugg: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "AddSelfOrMakeSized", "name", __self_0, "add_self_sugg",
                    __self_1, "make_sized_sugg", &__self_2),
            DynCompatibilityViolationSolution::ChangeToRefSelf(__self_0,
                __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f,
                    "ChangeToRefSelf", __self_0, &__self_1),
            DynCompatibilityViolationSolution::MoveToAnotherTrait(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "MoveToAnotherTrait", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for DynCompatibilityViolationSolution {
    #[inline]
    fn eq(&self, other: &DynCompatibilityViolationSolution) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                    name: __self_0,
                    add_self_sugg: __self_1,
                    make_sized_sugg: __self_2 },
                    DynCompatibilityViolationSolution::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,
                (DynCompatibilityViolationSolution::ChangeToRefSelf(__self_0,
                    __self_1),
                    DynCompatibilityViolationSolution::ChangeToRefSelf(__arg1_0,
                    __arg1_1)) => __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (DynCompatibilityViolationSolution::MoveToAnotherTrait(__self_0),
                    DynCompatibilityViolationSolution::MoveToAnotherTrait(__arg1_0))
                    => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for DynCompatibilityViolationSolution {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Symbol>;
        let _: ::core::cmp::AssertParamIsEq<(String, Span)>;
        let _: ::core::cmp::AssertParamIsEq<(String, Span)>;
        let _: ::core::cmp::AssertParamIsEq<Span>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for DynCompatibilityViolationSolution {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                name: __self_0,
                add_self_sugg: __self_1,
                make_sized_sugg: __self_2 } => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state);
                ::core::hash::Hash::hash(__self_2, state)
            }
            DynCompatibilityViolationSolution::ChangeToRefSelf(__self_0,
                __self_1) => {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
            DynCompatibilityViolationSolution::MoveToAnotherTrait(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, #[automatically_derived]
impl ::core::cmp::PartialOrd for DynCompatibilityViolationSolution {
    #[inline]
    fn partial_cmp(&self, other: &DynCompatibilityViolationSolution)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                name: __self_0,
                add_self_sugg: __self_1,
                make_sized_sugg: __self_2 },
                DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                name: __arg1_0,
                add_self_sugg: __arg1_1,
                make_sized_sugg: __arg1_2 }) =>
                match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
                    {
                    ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                        =>
                        match ::core::cmp::PartialOrd::partial_cmp(__self_1,
                                __arg1_1) {
                            ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                                => ::core::cmp::PartialOrd::partial_cmp(__self_2, __arg1_2),
                            cmp => cmp,
                        },
                    cmp => cmp,
                },
            (DynCompatibilityViolationSolution::ChangeToRefSelf(__self_0,
                __self_1),
                DynCompatibilityViolationSolution::ChangeToRefSelf(__arg1_0,
                __arg1_1)) =>
                match ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0)
                    {
                    ::core::option::Option::Some(::core::cmp::Ordering::Equal)
                        => ::core::cmp::PartialOrd::partial_cmp(__self_1, __arg1_1),
                    cmp => cmp,
                },
            (DynCompatibilityViolationSolution::MoveToAnotherTrait(__self_0),
                DynCompatibilityViolationSolution::MoveToAnotherTrait(__arg1_0))
                => ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Ord for DynCompatibilityViolationSolution {
    #[inline]
    fn cmp(&self, other: &DynCompatibilityViolationSolution)
        -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (DynCompatibilityViolationSolution::AddSelfOrMakeSized {
                        name: __self_0,
                        add_self_sugg: __self_1,
                        make_sized_sugg: __self_2 },
                        DynCompatibilityViolationSolution::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,
                        },
                    (DynCompatibilityViolationSolution::ChangeToRefSelf(__self_0,
                        __self_1),
                        DynCompatibilityViolationSolution::ChangeToRefSelf(__arg1_0,
                        __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (DynCompatibilityViolationSolution::MoveToAnotherTrait(__self_0),
                        DynCompatibilityViolationSolution::MoveToAnotherTrait(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord)]
909pub enum DynCompatibilityViolationSolution {
910    None,
911    AddSelfOrMakeSized {
912        name: Symbol,
913        add_self_sugg: (String, Span),
914        make_sized_sugg: (String, Span),
915    },
916    ChangeToRefSelf(Symbol, Span),
917    MoveToAnotherTrait(Symbol),
918}
919
920impl DynCompatibilityViolationSolution {
921    pub fn add_to<G: EmissionGuarantee>(self, err: &mut Diag<'_, G>) {
922        match self {
923            DynCompatibilityViolationSolution::None => {}
924            DynCompatibilityViolationSolution::AddSelfOrMakeSized {
925                name,
926                add_self_sugg,
927                make_sized_sugg,
928            } => {
929                err.span_suggestion(
930                    add_self_sugg.1,
931                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("consider turning `{0}` into a method by giving it a `&self` argument",
                name))
    })format!(
932                        "consider turning `{name}` into a method by giving it a `&self` argument"
933                    ),
934                    add_self_sugg.0,
935                    Applicability::MaybeIncorrect,
936                );
937                err.span_suggestion(
938                    make_sized_sugg.1,
939                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("alternatively, consider constraining `{0}` so it does not apply to trait objects",
                name))
    })format!(
940                        "alternatively, consider constraining `{name}` so it does not apply to \
941                             trait objects"
942                    ),
943                    make_sized_sugg.0,
944                    Applicability::MaybeIncorrect,
945                );
946            }
947            DynCompatibilityViolationSolution::ChangeToRefSelf(name, span) => {
948                err.span_suggestion(
949                    span,
950                    ::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`"),
951                    "&Self",
952                    Applicability::MachineApplicable,
953                );
954            }
955            DynCompatibilityViolationSolution::MoveToAnotherTrait(name) => {
956                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"));
957            }
958        }
959    }
960}
961
962/// Reasons a method might not be dyn-compatible.
963#[derive(#[automatically_derived]
impl ::core::clone::Clone for MethodViolation {
    #[inline]
    fn clone(&self) -> MethodViolation {
        match self {
            MethodViolation::StaticMethod(__self_0) =>
                MethodViolation::StaticMethod(::core::clone::Clone::clone(__self_0)),
            MethodViolation::ReferencesSelfInput(__self_0) =>
                MethodViolation::ReferencesSelfInput(::core::clone::Clone::clone(__self_0)),
            MethodViolation::ReferencesSelfOutput =>
                MethodViolation::ReferencesSelfOutput,
            MethodViolation::ReferencesImplTraitInTrait(__self_0) =>
                MethodViolation::ReferencesImplTraitInTrait(::core::clone::Clone::clone(__self_0)),
            MethodViolation::AsyncFn => MethodViolation::AsyncFn,
            MethodViolation::WhereClauseReferencesSelf =>
                MethodViolation::WhereClauseReferencesSelf,
            MethodViolation::Generic => MethodViolation::Generic,
            MethodViolation::CVariadic => MethodViolation::CVariadic,
            MethodViolation::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 {
            MethodViolation::StaticMethod(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "StaticMethod", &__self_0),
            MethodViolation::ReferencesSelfInput(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ReferencesSelfInput", &__self_0),
            MethodViolation::ReferencesSelfOutput =>
                ::core::fmt::Formatter::write_str(f, "ReferencesSelfOutput"),
            MethodViolation::ReferencesImplTraitInTrait(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ReferencesImplTraitInTrait", &__self_0),
            MethodViolation::AsyncFn =>
                ::core::fmt::Formatter::write_str(f, "AsyncFn"),
            MethodViolation::WhereClauseReferencesSelf =>
                ::core::fmt::Formatter::write_str(f,
                    "WhereClauseReferencesSelf"),
            MethodViolation::Generic =>
                ::core::fmt::Formatter::write_str(f, "Generic"),
            MethodViolation::CVariadic =>
                ::core::fmt::Formatter::write_str(f, "CVariadic"),
            MethodViolation::UndispatchableReceiver(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "UndispatchableReceiver", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for MethodViolation {
    #[inline]
    fn eq(&self, other: &MethodViolation) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (MethodViolation::StaticMethod(__self_0),
                    MethodViolation::StaticMethod(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (MethodViolation::ReferencesSelfInput(__self_0),
                    MethodViolation::ReferencesSelfInput(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (MethodViolation::ReferencesImplTraitInTrait(__self_0),
                    MethodViolation::ReferencesImplTraitInTrait(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (MethodViolation::UndispatchableReceiver(__self_0),
                    MethodViolation::UndispatchableReceiver(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for MethodViolation {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_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>>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for MethodViolation {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            MethodViolation::StaticMethod(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            MethodViolation::ReferencesSelfInput(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            MethodViolation::ReferencesImplTraitInTrait(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            MethodViolation::UndispatchableReceiver(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for MethodViolation {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    MethodViolation::StaticMethod(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    MethodViolation::ReferencesSelfInput(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    MethodViolation::ReferencesSelfOutput => {}
                    MethodViolation::ReferencesImplTraitInTrait(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    MethodViolation::AsyncFn => {}
                    MethodViolation::WhereClauseReferencesSelf => {}
                    MethodViolation::Generic => {}
                    MethodViolation::CVariadic => {}
                    MethodViolation::UndispatchableReceiver(ref __binding_0) =>
                        {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
964pub enum MethodViolation {
965    /// e.g., `fn foo()`
966    StaticMethod(Option<(/* add &self */ (String, Span), /* add Self: Sized */ (String, Span))>),
967
968    /// e.g., `fn foo(&self, x: Self)`
969    ReferencesSelfInput(Option<Span>),
970
971    /// e.g., `fn foo(&self) -> Self`
972    ReferencesSelfOutput,
973
974    /// e.g., `fn foo(&self) -> impl Sized`
975    ReferencesImplTraitInTrait(Span),
976
977    /// e.g., `async fn foo(&self)`
978    AsyncFn,
979
980    /// e.g., `fn foo(&self) where Self: Clone`
981    WhereClauseReferencesSelf,
982
983    /// e.g., `fn foo<A>()`
984    Generic,
985
986    /// e.g., `fn (mut ap: ...)`
987    CVariadic,
988
989    /// the method's receiver (`self` argument) can't be dispatched on
990    UndispatchableReceiver(Option<Span>),
991}
992
993/// Reasons an associated const might not be dyn compatible.
994#[derive(#[automatically_derived]
impl ::core::clone::Clone for AssocConstViolation {
    #[inline]
    fn clone(&self) -> AssocConstViolation {
        match self {
            AssocConstViolation::FeatureNotEnabled =>
                AssocConstViolation::FeatureNotEnabled,
            AssocConstViolation::Generic => AssocConstViolation::Generic,
            AssocConstViolation::NonType => AssocConstViolation::NonType,
            AssocConstViolation::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::Generic => "Generic",
                AssocConstViolation::NonType => "NonType",
                AssocConstViolation::TypeReferencesSelf =>
                    "TypeReferencesSelf",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for AssocConstViolation {
    #[inline]
    fn eq(&self, other: &AssocConstViolation) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for AssocConstViolation {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::hash::Hash for AssocConstViolation {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for AssocConstViolation {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    AssocConstViolation::FeatureNotEnabled => {}
                    AssocConstViolation::Generic => {}
                    AssocConstViolation::NonType => {}
                    AssocConstViolation::TypeReferencesSelf => {}
                }
            }
        }
    };HashStable)]
995pub enum AssocConstViolation {
996    /// Unstable feature `min_generic_const_args` wasn't enabled.
997    FeatureNotEnabled,
998
999    /// Has own generic parameters (GAC).
1000    Generic,
1001
1002    /// Isn't defined as `type const`.
1003    NonType,
1004
1005    /// Its type mentions the `Self` type parameter.
1006    TypeReferencesSelf,
1007}
1008
1009/// These are the error cases for `codegen_select_candidate`.
1010#[derive(#[automatically_derived]
impl ::core::marker::Copy for CodegenObligationError { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CodegenObligationError {
    #[inline]
    fn clone(&self) -> CodegenObligationError {
        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 {
            CodegenObligationError::Ambiguity =>
                ::core::fmt::Formatter::write_str(f, "Ambiguity"),
            CodegenObligationError::Unimplemented =>
                ::core::fmt::Formatter::write_str(f, "Unimplemented"),
            CodegenObligationError::UnconstrainedParam(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_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) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CodegenObligationError::UnconstrainedParam(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for CodegenObligationError {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    CodegenObligationError::Ambiguity => {}
                    CodegenObligationError::Unimplemented => {}
                    CodegenObligationError::UnconstrainedParam(ref __binding_0)
                        => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable, 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)]
1011pub enum CodegenObligationError {
1012    /// Ambiguity can happen when monomorphizing during trans
1013    /// expands to some humongous type that never occurred
1014    /// statically -- this humongous type can then overflow,
1015    /// leading to an ambiguous result. So report this as an
1016    /// overflow bug, since I believe this is the only case
1017    /// where ambiguity can result.
1018    Ambiguity,
1019    /// This can trigger when we have a global bound that is not actually satisfied
1020    /// due to trivial bounds.
1021    Unimplemented,
1022    /// The selected impl has unconstrained generic parameters. This will emit an error
1023    /// during impl WF checking.
1024    UnconstrainedParam(ErrorGuaranteed),
1025}