1pub mod query;
6pub mod select;
7pub mod solve;
8pub mod specialization_graph;
9mod structural_impls;
10
11use std::borrow::Cow;
12use std::hash::{Hash, Hasher};
13use std::sync::Arc;
14
15use rustc_errors::{Applicability, Diag, EmissionGuarantee, ErrorGuaranteed};
16use rustc_hir as hir;
17use rustc_hir::HirId;
18use rustc_hir::def_id::DefId;
19use rustc_macros::{
20 Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
21};
22use rustc_span::def_id::{CRATE_DEF_ID, LocalDefId};
23use rustc_span::{DUMMY_SP, Span, Symbol};
24use smallvec::{SmallVec, smallvec};
25use thin_vec::ThinVec;
26
27pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, SelectionCache};
28use crate::mir::ConstraintCategory;
29pub use crate::traits::solve::BuiltinImplSource;
30use crate::ty::abstract_const::NotConstEvaluatable;
31use crate::ty::{self, AdtKind, GenericArgsRef, Ty};
32
33#[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)]
42#[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)]
43pub struct ObligationCause<'tcx> {
44 pub span: Span,
45
46 pub body_id: LocalDefId,
53
54 code: ObligationCauseCodeHandle<'tcx>,
55}
56
57impl Hash for ObligationCause<'_> {
63 fn hash<H: Hasher>(&self, state: &mut H) {
64 self.body_id.hash(state);
65 self.span.hash(state);
66 }
67}
68
69impl<'tcx> ObligationCause<'tcx> {
70 #[inline]
71 pub fn new(
72 span: Span,
73 body_id: LocalDefId,
74 code: ObligationCauseCode<'tcx>,
75 ) -> ObligationCause<'tcx> {
76 ObligationCause { span, body_id, code: code.into() }
77 }
78
79 pub fn misc(span: Span, body_id: LocalDefId) -> ObligationCause<'tcx> {
80 ObligationCause::new(span, body_id, ObligationCauseCode::Misc)
81 }
82
83 #[inline(always)]
84 pub fn dummy() -> ObligationCause<'tcx> {
85 ObligationCause::dummy_with_span(DUMMY_SP)
86 }
87
88 #[inline(always)]
89 pub fn dummy_with_span(span: Span) -> ObligationCause<'tcx> {
90 ObligationCause { span, body_id: CRATE_DEF_ID, code: Default::default() }
91 }
92
93 #[inline]
94 pub fn code(&self) -> &ObligationCauseCode<'tcx> {
95 &self.code
96 }
97
98 pub fn map_code(
99 &mut self,
100 f: impl FnOnce(ObligationCauseCodeHandle<'tcx>) -> ObligationCauseCode<'tcx>,
101 ) {
102 self.code = f(std::mem::take(&mut self.code)).into();
103 }
104
105 pub fn derived_cause(
106 mut self,
107 parent_trait_pred: ty::PolyTraitPredicate<'tcx>,
108 variant: impl FnOnce(DerivedCause<'tcx>) -> ObligationCauseCode<'tcx>,
109 ) -> ObligationCause<'tcx> {
110 self.code = variant(DerivedCause { parent_trait_pred, parent_code: self.code }).into();
124 self
125 }
126
127 pub fn derived_host_cause(
128 mut self,
129 parent_host_pred: ty::Binder<'tcx, ty::HostEffectPredicate<'tcx>>,
130 variant: impl FnOnce(DerivedHostCause<'tcx>) -> ObligationCauseCode<'tcx>,
131 ) -> ObligationCause<'tcx> {
132 self.code = variant(DerivedHostCause { parent_host_pred, parent_code: self.code }).into();
133 self
134 }
135
136 pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {
137 match self.code() {
138 ObligationCauseCode::MatchImpl(cause, _) => cause.to_constraint_category(),
139 ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span) => {
140 ConstraintCategory::Predicate(*predicate_span)
141 }
142 _ => ConstraintCategory::BoringNoLocation,
143 }
144 }
145}
146
147#[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)]
149#[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)]
150pub struct ObligationCauseCodeHandle<'tcx> {
151 code: Option<Arc<ObligationCauseCode<'tcx>>>,
154}
155
156impl<'tcx> std::fmt::Debug for ObligationCauseCodeHandle<'tcx> {
157 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
158 let cause: &ObligationCauseCode<'_> = self;
159 cause.fmt(f)
160 }
161}
162
163impl<'tcx> ObligationCauseCode<'tcx> {
164 #[inline(always)]
165 fn into(self) -> ObligationCauseCodeHandle<'tcx> {
166 ObligationCauseCodeHandle {
167 code: if let ObligationCauseCode::Misc = self { None } else { Some(Arc::new(self)) },
168 }
169 }
170}
171
172impl<'tcx> std::ops::Deref for ObligationCauseCodeHandle<'tcx> {
173 type Target = ObligationCauseCode<'tcx>;
174
175 fn deref(&self) -> &Self::Target {
176 self.code.as_deref().unwrap_or(&ObligationCauseCode::Misc)
177 }
178}
179
180#[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)]
181#[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)]
182pub enum ObligationCauseCode<'tcx> {
183 Misc,
185
186 SliceOrArrayElem,
188
189 ArrayLen(Ty<'tcx>),
191
192 TupleElem,
194
195 WhereClause(DefId, Span),
198
199 OpaqueTypeBound(Span, Option<LocalDefId>),
203
204 WhereClauseInExpr(DefId, Span, HirId, usize),
209
210 HostEffectInExpr(DefId, Span, HirId, usize),
213
214 ReferenceOutlivesReferent(Ty<'tcx>),
216
217 ObjectTypeBound(Ty<'tcx>, ty::Region<'tcx>),
219
220 Coercion {
222 source: Ty<'tcx>,
223 target: Ty<'tcx>,
224 },
225
226 AssignmentLhsSized,
229 TupleInitializerSized,
231 StructInitializerSized,
233 VariableType(HirId),
235 SizedArgumentType(Option<HirId>),
237 SizedReturnType,
239 SizedCallReturnType,
241 SizedYieldType,
243 InlineAsmSized,
245 SizedClosureCapture(LocalDefId),
247 SizedCoroutineInterior(LocalDefId),
249 RepeatElementCopy {
251 is_constable: IsConstable,
254
255 elt_span: Span,
259 },
260
261 FieldSized {
263 adt_kind: AdtKind,
264 span: Span,
265 last: bool,
266 },
267
268 SizedConstOrStatic,
270
271 SharedStatic,
273
274 BuiltinDerived(DerivedCause<'tcx>),
277
278 ImplDerived(Box<ImplDerivedCause<'tcx>>),
281
282 WellFormedDerived(DerivedCause<'tcx>),
284
285 ImplDerivedHost(Box<ImplDerivedHostCause<'tcx>>),
288
289 BuiltinDerivedHost(DerivedHostCause<'tcx>),
292
293 FunctionArg {
296 arg_hir_id: HirId,
298 call_hir_id: HirId,
300 parent_code: ObligationCauseCodeHandle<'tcx>,
302 },
303
304 CompareImplItem {
307 impl_item_def_id: LocalDefId,
308 trait_item_def_id: DefId,
309 kind: ty::AssocKind,
310 },
311
312 CheckAssociatedTypeBounds {
314 impl_item_def_id: LocalDefId,
315 trait_item_def_id: DefId,
316 },
317
318 ExprAssignable,
320
321 MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>),
323
324 Pattern {
326 span: Option<Span>,
328 root_ty: Ty<'tcx>,
330 origin_expr: Option<PatternOriginExpr>,
332 },
333
334 IfExpression {
336 expr_id: HirId,
337 tail_defines_return_position_impl_trait: Option<LocalDefId>,
339 },
340
341 IfExpressionWithNoElse,
343
344 MainFunctionType,
346
347 LangFunctionType(Symbol),
349
350 IntrinsicType,
352
353 LetElse,
355
356 MethodReceiver,
358
359 ReturnNoExpression,
361
362 ReturnValue(HirId),
364
365 OpaqueReturnType(Option<(Ty<'tcx>, HirId)>),
367
368 BlockTailExpression(HirId, hir::MatchSource),
370
371 TrivialBound,
373
374 AwaitableExpr(HirId),
375
376 ForLoopIterator,
377
378 QuestionMark,
379
380 WellFormed(Option<WellFormedLoc>),
387
388 MatchImpl(ObligationCause<'tcx>, DefId),
391
392 UnOp {
393 hir_id: HirId,
394 },
395
396 BinOp {
397 lhs_hir_id: HirId,
398 rhs_hir_id: HirId,
399 rhs_span: Span,
400 rhs_is_lit: bool,
401 output_ty: Option<Ty<'tcx>>,
402 },
403
404 AscribeUserTypeProvePredicate(Span),
405
406 RustCall,
407
408 DynCompatible(Span),
409
410 AlwaysApplicableImpl,
413
414 ConstParam(Ty<'tcx>),
416
417 TypeAlias(ObligationCauseCodeHandle<'tcx>, Span, DefId),
419
420 UnsizedNonPlaceExpr(Span),
423
424 CompareEii {
427 external_impl: LocalDefId,
428 declaration: DefId,
429 },
430}
431
432#[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)]
435pub enum IsConstable {
436 No,
437 Fn,
439 Ctor,
441}
442
443#[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)]
448#[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)]
449pub enum WellFormedLoc {
450 Ty(LocalDefId),
452 Param {
456 function: LocalDefId,
458 param_idx: usize,
462 },
463}
464
465impl<'tcx> ObligationCauseCode<'tcx> {
466 pub fn peel_derives(&self) -> &Self {
468 let mut base_cause = self;
469 while let Some(parent_code) = base_cause.parent() {
470 base_cause = parent_code;
471 }
472 base_cause
473 }
474
475 pub fn parent(&self) -> Option<&Self> {
476 match self {
477 ObligationCauseCode::FunctionArg { parent_code, .. } => Some(parent_code),
478 ObligationCauseCode::BuiltinDerived(derived)
479 | ObligationCauseCode::WellFormedDerived(derived)
480 | ObligationCauseCode::ImplDerived(box ImplDerivedCause { derived, .. }) => {
481 Some(&derived.parent_code)
482 }
483 ObligationCauseCode::BuiltinDerivedHost(derived)
484 | ObligationCauseCode::ImplDerivedHost(box ImplDerivedHostCause { derived, .. }) => {
485 Some(&derived.parent_code)
486 }
487 _ => None,
488 }
489 }
490
491 pub fn peel_derives_with_predicate(&self) -> (&Self, Option<ty::PolyTraitPredicate<'tcx>>) {
494 let mut base_cause = self;
495 let mut base_trait_pred = None;
496 while let Some((parent_code, parent_pred)) = base_cause.parent_with_predicate() {
497 base_cause = parent_code;
498 if let Some(parent_pred) = parent_pred {
499 base_trait_pred = Some(parent_pred);
500 }
501 }
502
503 (base_cause, base_trait_pred)
504 }
505
506 pub fn parent_with_predicate(&self) -> Option<(&Self, Option<ty::PolyTraitPredicate<'tcx>>)> {
507 match self {
508 ObligationCauseCode::FunctionArg { parent_code, .. } => Some((parent_code, None)),
509 ObligationCauseCode::BuiltinDerived(derived)
510 | ObligationCauseCode::WellFormedDerived(derived)
511 | ObligationCauseCode::ImplDerived(box ImplDerivedCause { derived, .. }) => {
512 Some((&derived.parent_code, Some(derived.parent_trait_pred)))
513 }
514 _ => None,
515 }
516 }
517
518 pub fn peel_match_impls(&self) -> &Self {
519 match self {
520 ObligationCauseCode::MatchImpl(cause, _) => cause.code(),
521 _ => self,
522 }
523 }
524}
525
526#[cfg(target_pointer_width = "64")]
528const _: [(); 48] = [(); ::std::mem::size_of::<ObligationCauseCode<'_>>()];rustc_data_structures::static_assert_size!(ObligationCauseCode<'_>, 48);
529
530#[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)]
531#[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)]
532pub struct MatchExpressionArmCause<'tcx> {
533 pub arm_block_id: Option<HirId>,
534 pub arm_ty: Ty<'tcx>,
535 pub arm_span: Span,
536 pub prior_arm_block_id: Option<HirId>,
537 pub prior_arm_ty: Ty<'tcx>,
538 pub prior_arm_span: Span,
539 pub scrut_span: Span,
541 pub source: hir::MatchSource,
543 pub expr_span: Span,
545 pub prior_non_diverging_arms: Vec<Span>,
549 pub tail_defines_return_position_impl_trait: Option<LocalDefId>,
551}
552
553#[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)]
557#[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)]
558pub struct PatternOriginExpr {
559 pub peeled_span: Span,
565 pub peeled_count: usize,
567 pub peeled_prefix_suggestion_parentheses: bool,
570}
571
572#[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)]
573#[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)]
574pub struct DerivedCause<'tcx> {
575 pub parent_trait_pred: ty::PolyTraitPredicate<'tcx>,
580
581 pub parent_code: ObligationCauseCodeHandle<'tcx>,
583}
584
585#[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)]
586#[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)]
587pub struct ImplDerivedCause<'tcx> {
588 pub derived: DerivedCause<'tcx>,
589 pub impl_or_alias_def_id: DefId,
594 pub impl_def_predicate_index: Option<usize>,
596 pub span: Span,
597}
598
599#[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)]
600#[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)]
601pub struct DerivedHostCause<'tcx> {
602 pub parent_host_pred: ty::Binder<'tcx, ty::HostEffectPredicate<'tcx>>,
607
608 pub parent_code: ObligationCauseCodeHandle<'tcx>,
610}
611
612#[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)]
613#[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)]
614pub struct ImplDerivedHostCause<'tcx> {
615 pub derived: DerivedHostCause<'tcx>,
616 pub impl_def_id: DefId,
618 pub span: Span,
619}
620
621#[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)]
622pub enum SelectionError<'tcx> {
623 Unimplemented,
625 SignatureMismatch(Box<SignatureMismatchData<'tcx>>),
629 TraitDynIncompatible(DefId),
631 NotConstEvaluatable(NotConstEvaluatable),
633 Overflow(OverflowError),
635 OpaqueTypeAutoTraitLeakageUnknown(DefId),
639 ConstArgHasWrongType { ct: ty::Const<'tcx>, ct_ty: Ty<'tcx>, expected_ty: Ty<'tcx> },
641}
642
643#[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)]
644pub struct SignatureMismatchData<'tcx> {
645 pub found_trait_ref: ty::TraitRef<'tcx>,
646 pub expected_trait_ref: ty::TraitRef<'tcx>,
647 pub terr: ty::error::TypeError<'tcx>,
648}
649
650pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
658
659#[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)]
689#[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)]
690pub enum ImplSource<'tcx, N> {
691 UserDefined(ImplSourceUserDefinedData<'tcx, N>),
693
694 Param(ThinVec<N>),
699
700 Builtin(BuiltinImplSource, ThinVec<N>),
702}
703
704impl<'tcx, N> ImplSource<'tcx, N> {
705 pub fn nested_obligations(self) -> ThinVec<N> {
706 match self {
707 ImplSource::UserDefined(i) => i.nested,
708 ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
709 }
710 }
711
712 pub fn borrow_nested_obligations(&self) -> &[N] {
713 match self {
714 ImplSource::UserDefined(i) => &i.nested,
715 ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
716 }
717 }
718
719 pub fn borrow_nested_obligations_mut(&mut self) -> &mut [N] {
720 match self {
721 ImplSource::UserDefined(i) => &mut i.nested,
722 ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
723 }
724 }
725
726 pub fn map<M, F>(self, f: F) -> ImplSource<'tcx, M>
727 where
728 F: FnMut(N) -> M,
729 {
730 match self {
731 ImplSource::UserDefined(i) => ImplSource::UserDefined(ImplSourceUserDefinedData {
732 impl_def_id: i.impl_def_id,
733 args: i.args,
734 nested: i.nested.into_iter().map(f).collect(),
735 }),
736 ImplSource::Param(n) => ImplSource::Param(n.into_iter().map(f).collect()),
737 ImplSource::Builtin(source, n) => {
738 ImplSource::Builtin(source, n.into_iter().map(f).collect())
739 }
740 }
741 }
742}
743
744#[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)]
755#[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)]
756pub struct ImplSourceUserDefinedData<'tcx, N> {
757 pub impl_def_id: DefId,
758 pub args: GenericArgsRef<'tcx>,
759 pub nested: ThinVec<N>,
760}
761
762#[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)]
763pub enum DynCompatibilityViolation {
764 ExplicitlyDynIncompatible(SmallVec<[Span; 1]>),
766
767 SizedSelf(SmallVec<[Span; 1]>),
769
770 SupertraitSelf(SmallVec<[Span; 1]>),
773
774 SupertraitNonLifetimeBinder(SmallVec<[Span; 1]>),
776
777 SupertraitConst(SmallVec<[Span; 1]>),
779
780 Method(Symbol, MethodViolation, Span),
782
783 AssocConst(Symbol, AssocConstViolation, Span),
785
786 GenericAssocTy(Symbol, Span),
788}
789
790impl DynCompatibilityViolation {
791 pub fn error_msg(&self) -> Cow<'static, str> {
792 match self {
796 Self::ExplicitlyDynIncompatible(_) => "it opted out of dyn-compatibility".into(),
797 Self::SizedSelf(_) => "it requires `Self: Sized`".into(),
798 Self::SupertraitSelf(spans) => {
799 if spans.iter().any(|sp| *sp != DUMMY_SP) {
800 "it uses `Self` as a type parameter".into()
801 } else {
802 "it cannot use `Self` as a type parameter in a supertrait or `where`-clause"
803 .into()
804 }
805 }
806 Self::SupertraitNonLifetimeBinder(_) => {
807 "where clause cannot reference non-lifetime `for<...>` variables".into()
808 }
809 Self::SupertraitConst(_) => "it cannot have a `const` supertrait".into(),
810 Self::Method(name, MethodViolation::StaticMethod(_), _) => {
811 ::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()
812 }
813 Self::Method(name, MethodViolation::ReferencesSelfInput(_), DUMMY_SP) => {
814 ::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()
815 }
816 Self::Method(name, MethodViolation::ReferencesSelfInput(_), _) => {
817 ::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()
818 }
819 Self::Method(name, MethodViolation::ReferencesSelfOutput, _) => {
820 ::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()
821 }
822 Self::Method(name, MethodViolation::ReferencesImplTraitInTrait(_), _) => {
823 ::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()
824 }
825 Self::Method(name, MethodViolation::AsyncFn, _) => {
826 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("method `{0}` is `async`", name))
})format!("method `{name}` is `async`").into()
827 }
828 Self::Method(name, MethodViolation::CVariadic, _) => {
829 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("method `{0}` is C-variadic", name))
})format!("method `{name}` is C-variadic").into()
830 }
831 Self::Method(name, MethodViolation::WhereClauseReferencesSelf, _) => {
832 ::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()
833 }
834 Self::Method(name, MethodViolation::Generic, _) => {
835 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("method `{0}` has generic type parameters",
name))
})format!("method `{name}` has generic type parameters").into()
836 }
837 Self::Method(name, MethodViolation::UndispatchableReceiver(_), _) => {
838 ::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()
839 }
840 Self::AssocConst(name, AssocConstViolation::FeatureNotEnabled, _) => {
841 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains associated const `{0}`",
name))
})format!("it contains associated const `{name}`").into()
842 }
843 Self::AssocConst(name, AssocConstViolation::Generic, _) => {
844 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains generic associated const `{0}`",
name))
})format!("it contains generic associated const `{name}`").into()
845 }
846 Self::AssocConst(name, AssocConstViolation::NonType, _) => {
847 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains associated const `{0}` that\'s not marked `#[type_const]`",
name))
})format!("it contains associated const `{name}` that's not marked `#[type_const]`")
848 .into()
849 }
850 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!(
851 "it contains associated const `{name}` whose type references the `Self` type"
852 )
853 .into(),
854 Self::GenericAssocTy(name, _) => {
855 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains generic associated type `{0}`",
name))
})format!("it contains generic associated type `{name}`").into()
856 }
857 }
858 }
859
860 pub fn solution(&self) -> DynCompatibilityViolationSolution {
861 match self {
862 Self::ExplicitlyDynIncompatible(_)
863 | Self::SizedSelf(_)
864 | Self::SupertraitSelf(_)
865 | Self::SupertraitNonLifetimeBinder(..)
866 | Self::SupertraitConst(_) => DynCompatibilityViolationSolution::None,
867 Self::Method(
868 name,
869 MethodViolation::StaticMethod(Some((add_self_sugg, make_sized_sugg))),
870 _,
871 ) => DynCompatibilityViolationSolution::AddSelfOrMakeSized {
872 name: *name,
873 add_self_sugg: add_self_sugg.clone(),
874 make_sized_sugg: make_sized_sugg.clone(),
875 },
876 Self::Method(name, MethodViolation::UndispatchableReceiver(Some(span)), _) => {
877 DynCompatibilityViolationSolution::ChangeToRefSelf(*name, *span)
878 }
879 Self::Method(name, ..) | Self::AssocConst(name, ..) | Self::GenericAssocTy(name, _) => {
880 DynCompatibilityViolationSolution::MoveToAnotherTrait(*name)
881 }
882 }
883 }
884
885 pub fn spans(&self) -> SmallVec<[Span; 1]> {
886 match self {
889 Self::ExplicitlyDynIncompatible(spans)
890 | Self::SizedSelf(spans)
891 | Self::SupertraitSelf(spans)
892 | Self::SupertraitNonLifetimeBinder(spans)
893 | Self::SupertraitConst(spans) => spans.clone(),
894 Self::Method(_, _, span)
895 | Self::AssocConst(_, _, span)
896 | Self::GenericAssocTy(_, span) => {
897 if *span != DUMMY_SP {
898 {
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]
899 } else {
900 ::smallvec::SmallVec::new()smallvec![]
901 }
902 }
903 }
904 }
905}
906
907#[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)]
908pub enum DynCompatibilityViolationSolution {
909 None,
910 AddSelfOrMakeSized {
911 name: Symbol,
912 add_self_sugg: (String, Span),
913 make_sized_sugg: (String, Span),
914 },
915 ChangeToRefSelf(Symbol, Span),
916 MoveToAnotherTrait(Symbol),
917}
918
919impl DynCompatibilityViolationSolution {
920 pub fn add_to<G: EmissionGuarantee>(self, err: &mut Diag<'_, G>) {
921 match self {
922 DynCompatibilityViolationSolution::None => {}
923 DynCompatibilityViolationSolution::AddSelfOrMakeSized {
924 name,
925 add_self_sugg,
926 make_sized_sugg,
927 } => {
928 err.span_suggestion(
929 add_self_sugg.1,
930 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("consider turning `{0}` into a method by giving it a `&self` argument",
name))
})format!(
931 "consider turning `{name}` into a method by giving it a `&self` argument"
932 ),
933 add_self_sugg.0,
934 Applicability::MaybeIncorrect,
935 );
936 err.span_suggestion(
937 make_sized_sugg.1,
938 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("alternatively, consider constraining `{0}` so it does not apply to trait objects",
name))
})format!(
939 "alternatively, consider constraining `{name}` so it does not apply to \
940 trait objects"
941 ),
942 make_sized_sugg.0,
943 Applicability::MaybeIncorrect,
944 );
945 }
946 DynCompatibilityViolationSolution::ChangeToRefSelf(name, span) => {
947 err.span_suggestion(
948 span,
949 ::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`"),
950 "&Self",
951 Applicability::MachineApplicable,
952 );
953 }
954 DynCompatibilityViolationSolution::MoveToAnotherTrait(name) => {
955 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"));
956 }
957 }
958 }
959}
960
961#[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)]
963pub enum MethodViolation {
964 StaticMethod(Option<((String, Span), (String, Span))>),
966
967 ReferencesSelfInput(Option<Span>),
969
970 ReferencesSelfOutput,
972
973 ReferencesImplTraitInTrait(Span),
975
976 AsyncFn,
978
979 WhereClauseReferencesSelf,
981
982 Generic,
984
985 CVariadic,
987
988 UndispatchableReceiver(Option<Span>),
990}
991
992#[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)]
994pub enum AssocConstViolation {
995 FeatureNotEnabled,
997
998 Generic,
1000
1001 NonType,
1003
1004 TypeReferencesSelf,
1006}
1007
1008#[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)]
1010pub enum CodegenObligationError {
1011 Ambiguity,
1018 Unimplemented,
1021 UnconstrainedParam(ErrorGuaranteed),
1024}