1pub mod cache;
6pub mod query;
7pub mod select;
8pub mod solve;
9pub mod specialization_graph;
10mod structural_impls;
11
12use std::borrow::Cow;
13use std::hash::{Hash, Hasher};
14use std::sync::Arc;
15
16use rustc_errors::{Applicability, Diag, ErrorGuaranteed};
17use rustc_hir as hir;
18use rustc_hir::HirId;
19use rustc_hir::def_id::DefId;
20use rustc_macros::{
21 Decodable, Encodable, StableHash, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable,
22};
23use rustc_span::def_id::{CRATE_DEF_ID, LocalDefId};
24use rustc_span::{DUMMY_SP, OrdSpan, Span, Symbol, sym};
25use smallvec::{SmallVec, smallvec};
26use thin_vec::ThinVec;
27
28pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, SelectionCache};
29use crate::mir::ConstraintCategory;
30pub use crate::traits::solve::BuiltinImplSource;
31use crate::ty::abstract_const::NotConstEvaluatable;
32use crate::ty::{self, AdtKind, GenericArgs, Ty};
33
34#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
ObligationCause<'tcx> {
#[inline]
fn clone(&self) -> Self {
ObligationCause {
span: ::core::clone::Clone::clone(&self.span),
body_def_id: ::core::clone::Clone::clone(&self.body_def_id),
code: ::core::clone::Clone::clone(&self.code),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
ObligationCause<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"ObligationCause span body_def_id code", &self.span,
&self.body_def_id, &&self.code)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
ObligationCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
ObligationCause<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.span == other.span && self.body_def_id == other.body_def_id &&
self.code == other.code
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for ObligationCause<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Span>;
let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
ObligationCause<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ObligationCause {
span: ref __binding_0,
body_def_id: ref __binding_1,
code: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for ObligationCause<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let ObligationCause {
span: ref __binding_0,
body_def_id: ref __binding_1,
code: ref __binding_2 } = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for ObligationCause<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
ObligationCause {
span: ::rustc_serialize::Decodable::decode(__decoder),
body_def_id: ::rustc_serialize::Decodable::decode(__decoder),
code: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
43#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for ObligationCause<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ObligationCause {
span: ref __binding_0,
body_def_id: ref __binding_1,
code: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for ObligationCause<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ObligationCause {
span: __binding_0,
body_def_id: __binding_1,
code: __binding_2 } => {
ObligationCause {
span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
body_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
ObligationCause {
span: __binding_0,
body_def_id: __binding_1,
code: __binding_2 } => {
ObligationCause {
span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
body_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
}
}
}
}
}
};TypeFoldable)]
44pub struct ObligationCause<'tcx> {
45 pub span: Span,
46
47 pub body_def_id: LocalDefId,
54
55 code: ObligationCauseCodeHandle<'tcx>,
56}
57
58impl Hash for ObligationCause<'_> {
64 fn hash<H: Hasher>(&self, state: &mut H) {
65 self.body_def_id.hash(state);
66 self.span.hash(state);
67 }
68}
69
70impl<'tcx> ObligationCause<'tcx> {
71 #[inline]
72 pub fn new(
73 span: Span,
74 body_def_id: LocalDefId,
75 code: ObligationCauseCode<'tcx>,
76 ) -> ObligationCause<'tcx> {
77 ObligationCause { span, body_def_id, code: code.into() }
78 }
79
80 pub fn misc(span: Span, body_def_id: LocalDefId) -> ObligationCause<'tcx> {
81 ObligationCause::new(span, body_def_id, ObligationCauseCode::Misc)
82 }
83
84 #[inline(always)]
85 pub fn dummy() -> ObligationCause<'tcx> {
86 ObligationCause::dummy_with_span(DUMMY_SP)
87 }
88
89 #[inline(always)]
90 pub fn dummy_with_span(span: Span) -> ObligationCause<'tcx> {
91 ObligationCause { span, body_def_id: CRATE_DEF_ID, code: Default::default() }
92 }
93
94 #[inline]
95 pub fn code(&self) -> &ObligationCauseCode<'tcx> {
96 &self.code
97 }
98
99 pub fn map_code(
100 &mut self,
101 f: impl FnOnce(ObligationCauseCodeHandle<'tcx>) -> ObligationCauseCode<'tcx>,
102 ) {
103 self.code = f(std::mem::take(&mut self.code)).into();
104 }
105
106 pub fn derived_cause(
107 mut self,
108 parent_trait_pred: ty::PolyTraitClause<'tcx>,
109 variant: impl FnOnce(DerivedCause<'tcx>) -> ObligationCauseCode<'tcx>,
110 ) -> ObligationCause<'tcx> {
111 self.code = variant(DerivedCause { parent_trait_pred, parent_code: self.code }).into();
125 self
126 }
127
128 pub fn derived_host_cause(
129 mut self,
130 parent_host_clause: ty::Binder<'tcx, ty::HostEffectClause<'tcx>>,
131 variant: impl FnOnce(DerivedHostCause<'tcx>) -> ObligationCauseCode<'tcx>,
132 ) -> ObligationCause<'tcx> {
133 self.code = variant(DerivedHostCause { parent_host_clause, parent_code: self.code }).into();
134 self
135 }
136
137 pub fn to_constraint_category(&self) -> ConstraintCategory<'tcx> {
138 match self.code() {
139 ObligationCauseCode::MatchImpl(cause, _) => cause.to_constraint_category(),
140 ObligationCauseCode::AscribeUserTypeProvePredicate(predicate_span, def_id) => {
141 ConstraintCategory::Predicate(*predicate_span, *def_id)
142 }
143 _ => ConstraintCategory::BoringNoLocation,
144 }
145 }
146}
147
148#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
ObligationCauseCodeHandle<'tcx> {
#[inline]
fn clone(&self) -> Self {
ObligationCauseCodeHandle {
code: ::core::clone::Clone::clone(&self.code),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
ObligationCauseCodeHandle<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
ObligationCauseCodeHandle<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool { self.code == other.code }
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
ObligationCauseCodeHandle<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _:
::core::cmp::AssertParamIsEq<Option<Arc<ObligationCauseCode<'tcx>>>>;
}
}Eq, #[automatically_derived]impl<'tcx> ::core::default::Default for
ObligationCauseCodeHandle<'tcx> {
#[inline]
fn default() -> Self {
ObligationCauseCodeHandle {
code: ::core::default::Default::default(),
}
}
}Default, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
ObligationCauseCodeHandle<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ObligationCauseCodeHandle { code: ref __binding_0 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash)]
150#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for ObligationCauseCodeHandle<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ObligationCauseCodeHandle { code: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for ObligationCauseCodeHandle<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ObligationCauseCodeHandle { code: __binding_0 } => {
ObligationCauseCodeHandle {
code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
ObligationCauseCodeHandle { code: __binding_0 } => {
ObligationCauseCodeHandle {
code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for
ObligationCauseCodeHandle<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let ObligationCauseCodeHandle { code: ref __binding_0 } =
*self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for
ObligationCauseCodeHandle<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
ObligationCauseCodeHandle {
code: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
151pub struct ObligationCauseCodeHandle<'tcx> {
152 code: Option<Arc<ObligationCauseCode<'tcx>>>,
155}
156
157impl<'tcx> std::fmt::Debug for ObligationCauseCodeHandle<'tcx> {
158 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
159 let cause: &ObligationCauseCode<'_> = self;
160 cause.fmt(f)
161 }
162}
163
164impl<'tcx> ObligationCauseCode<'tcx> {
165 #[inline(always)]
166 fn into(self) -> ObligationCauseCodeHandle<'tcx> {
167 ObligationCauseCodeHandle {
168 code: if let ObligationCauseCode::Misc = self { None } else { Some(Arc::new(self)) },
169 }
170 }
171}
172
173impl<'tcx> std::ops::Deref for ObligationCauseCodeHandle<'tcx> {
174 type Target = ObligationCauseCode<'tcx>;
175
176 fn deref(&self) -> &Self::Target {
177 self.code.as_deref().unwrap_or(&ObligationCauseCode::Misc)
178 }
179}
180
181#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
ObligationCauseCode<'tcx> {
#[inline]
fn clone(&self) -> Self {
match self {
Self::Misc => ObligationCauseCode::Misc,
Self::SliceOrArrayElem => ObligationCauseCode::SliceOrArrayElem,
Self::ArrayLen(__self_0) =>
ObligationCauseCode::ArrayLen(::core::clone::Clone::clone(__self_0)),
Self::TupleElem => ObligationCauseCode::TupleElem,
Self::WhereClause(__self_0, __self_1) =>
ObligationCauseCode::WhereClause(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
Self::OpaqueTypeBound(__self_0, __self_1) =>
ObligationCauseCode::OpaqueTypeBound(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
Self::WhereClauseInExpr(__self_0, __self_1, __self_2, __self_3) =>
ObligationCauseCode::WhereClauseInExpr(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1),
::core::clone::Clone::clone(__self_2),
::core::clone::Clone::clone(__self_3)),
Self::HostEffectInExpr(__self_0, __self_1, __self_2, __self_3) =>
ObligationCauseCode::HostEffectInExpr(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1),
::core::clone::Clone::clone(__self_2),
::core::clone::Clone::clone(__self_3)),
Self::ReferenceOutlivesReferent(__self_0) =>
ObligationCauseCode::ReferenceOutlivesReferent(::core::clone::Clone::clone(__self_0)),
Self::ObjectTypeBound(__self_0, __self_1) =>
ObligationCauseCode::ObjectTypeBound(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
Self::Coercion { source: __self_0, target: __self_1 } =>
ObligationCauseCode::Coercion {
source: ::core::clone::Clone::clone(__self_0),
target: ::core::clone::Clone::clone(__self_1),
},
Self::AssignmentLhsSized =>
ObligationCauseCode::AssignmentLhsSized,
Self::TupleInitializerSized =>
ObligationCauseCode::TupleInitializerSized,
Self::StructInitializerSized =>
ObligationCauseCode::StructInitializerSized,
Self::VariableType(__self_0) =>
ObligationCauseCode::VariableType(::core::clone::Clone::clone(__self_0)),
Self::SizedArgumentType(__self_0) =>
ObligationCauseCode::SizedArgumentType(::core::clone::Clone::clone(__self_0)),
Self::SizedReturnType => ObligationCauseCode::SizedReturnType,
Self::SizedCallReturnType(__self_0) =>
ObligationCauseCode::SizedCallReturnType(::core::clone::Clone::clone(__self_0)),
Self::SizedYieldType => ObligationCauseCode::SizedYieldType,
Self::InlineAsmSized => ObligationCauseCode::InlineAsmSized,
Self::SizedClosureCapture(__self_0) =>
ObligationCauseCode::SizedClosureCapture(::core::clone::Clone::clone(__self_0)),
Self::SizedCoroutineInterior(__self_0) =>
ObligationCauseCode::SizedCoroutineInterior(::core::clone::Clone::clone(__self_0)),
Self::RepeatElementCopy {
is_constable: __self_0, elt_span: __self_1 } =>
ObligationCauseCode::RepeatElementCopy {
is_constable: ::core::clone::Clone::clone(__self_0),
elt_span: ::core::clone::Clone::clone(__self_1),
},
Self::FieldSized {
adt_kind: __self_0, span: __self_1, last: __self_2 } =>
ObligationCauseCode::FieldSized {
adt_kind: ::core::clone::Clone::clone(__self_0),
span: ::core::clone::Clone::clone(__self_1),
last: ::core::clone::Clone::clone(__self_2),
},
Self::SizedConstOrStatic =>
ObligationCauseCode::SizedConstOrStatic,
Self::SharedStatic => ObligationCauseCode::SharedStatic,
Self::BuiltinDerived(__self_0) =>
ObligationCauseCode::BuiltinDerived(::core::clone::Clone::clone(__self_0)),
Self::ImplDerived(__self_0) =>
ObligationCauseCode::ImplDerived(::core::clone::Clone::clone(__self_0)),
Self::WellFormedDerived(__self_0) =>
ObligationCauseCode::WellFormedDerived(::core::clone::Clone::clone(__self_0)),
Self::ImplDerivedHost(__self_0) =>
ObligationCauseCode::ImplDerivedHost(::core::clone::Clone::clone(__self_0)),
Self::BuiltinDerivedHost(__self_0) =>
ObligationCauseCode::BuiltinDerivedHost(::core::clone::Clone::clone(__self_0)),
Self::FunctionArg {
arg_hir_id: __self_0,
call_hir_id: __self_1,
parent_code: __self_2 } =>
ObligationCauseCode::FunctionArg {
arg_hir_id: ::core::clone::Clone::clone(__self_0),
call_hir_id: ::core::clone::Clone::clone(__self_1),
parent_code: ::core::clone::Clone::clone(__self_2),
},
Self::CompareImplItem {
impl_item_def_id: __self_0,
trait_item_def_id: __self_1,
kind: __self_2 } =>
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ::core::clone::Clone::clone(__self_0),
trait_item_def_id: ::core::clone::Clone::clone(__self_1),
kind: ::core::clone::Clone::clone(__self_2),
},
Self::CheckAssociatedTypeBounds {
impl_item_def_id: __self_0, trait_item_def_id: __self_1 } =>
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ::core::clone::Clone::clone(__self_0),
trait_item_def_id: ::core::clone::Clone::clone(__self_1),
},
Self::ExprAssignable => ObligationCauseCode::ExprAssignable,
Self::MatchExpressionArm(__self_0) =>
ObligationCauseCode::MatchExpressionArm(::core::clone::Clone::clone(__self_0)),
Self::Pattern {
span: __self_0, root_ty: __self_1, origin_expr: __self_2 } =>
ObligationCauseCode::Pattern {
span: ::core::clone::Clone::clone(__self_0),
root_ty: ::core::clone::Clone::clone(__self_1),
origin_expr: ::core::clone::Clone::clone(__self_2),
},
Self::IfExpression {
expr_id: __self_0,
tail_defines_return_position_impl_trait: __self_1 } =>
ObligationCauseCode::IfExpression {
expr_id: ::core::clone::Clone::clone(__self_0),
tail_defines_return_position_impl_trait: ::core::clone::Clone::clone(__self_1),
},
Self::IfExpressionWithNoElse =>
ObligationCauseCode::IfExpressionWithNoElse,
Self::MainFunctionType => ObligationCauseCode::MainFunctionType,
Self::LangFunctionType(__self_0) =>
ObligationCauseCode::LangFunctionType(::core::clone::Clone::clone(__self_0)),
Self::IntrinsicType => ObligationCauseCode::IntrinsicType,
Self::LetElse => ObligationCauseCode::LetElse,
Self::MethodReceiver => ObligationCauseCode::MethodReceiver,
Self::ReturnNoExpression =>
ObligationCauseCode::ReturnNoExpression,
Self::ReturnValue(__self_0) =>
ObligationCauseCode::ReturnValue(::core::clone::Clone::clone(__self_0)),
Self::OpaqueReturnType(__self_0) =>
ObligationCauseCode::OpaqueReturnType(::core::clone::Clone::clone(__self_0)),
Self::ReturnType => ObligationCauseCode::ReturnType,
Self::BlockTailExpression(__self_0, __self_1) =>
ObligationCauseCode::BlockTailExpression(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
Self::TrivialBound => ObligationCauseCode::TrivialBound,
Self::AwaitableExpr(__self_0) =>
ObligationCauseCode::AwaitableExpr(::core::clone::Clone::clone(__self_0)),
Self::ForLoopIterator(__self_0) =>
ObligationCauseCode::ForLoopIterator(::core::clone::Clone::clone(__self_0)),
Self::QuestionMark => ObligationCauseCode::QuestionMark,
Self::WellFormed(__self_0) =>
ObligationCauseCode::WellFormed(::core::clone::Clone::clone(__self_0)),
Self::MatchImpl(__self_0, __self_1) =>
ObligationCauseCode::MatchImpl(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
Self::UnOp { hir_id: __self_0 } =>
ObligationCauseCode::UnOp {
hir_id: ::core::clone::Clone::clone(__self_0),
},
Self::BinOp {
lhs_hir_id: __self_0,
rhs_hir_id: __self_1,
rhs_span: __self_2,
rhs_is_lit: __self_3,
output_ty: __self_4 } =>
ObligationCauseCode::BinOp {
lhs_hir_id: ::core::clone::Clone::clone(__self_0),
rhs_hir_id: ::core::clone::Clone::clone(__self_1),
rhs_span: ::core::clone::Clone::clone(__self_2),
rhs_is_lit: ::core::clone::Clone::clone(__self_3),
output_ty: ::core::clone::Clone::clone(__self_4),
},
Self::AscribeUserTypeProvePredicate(__self_0, __self_1) =>
ObligationCauseCode::AscribeUserTypeProvePredicate(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
Self::RustCall => ObligationCauseCode::RustCall,
Self::DynCompatible(__self_0) =>
ObligationCauseCode::DynCompatible(::core::clone::Clone::clone(__self_0)),
Self::AlwaysApplicableImpl =>
ObligationCauseCode::AlwaysApplicableImpl,
Self::ConstParam(__self_0) =>
ObligationCauseCode::ConstParam(::core::clone::Clone::clone(__self_0)),
Self::ConstItemTy(__self_0) =>
ObligationCauseCode::ConstItemTy(::core::clone::Clone::clone(__self_0)),
Self::TypeAlias(__self_0, __self_1, __self_2) =>
ObligationCauseCode::TypeAlias(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1),
::core::clone::Clone::clone(__self_2)),
Self::UnsizedNonPlaceExpr(__self_0) =>
ObligationCauseCode::UnsizedNonPlaceExpr(::core::clone::Clone::clone(__self_0)),
Self::CompareEii { external_impl: __self_0, declaration: __self_1
} =>
ObligationCauseCode::CompareEii {
external_impl: ::core::clone::Clone::clone(__self_0),
declaration: ::core::clone::Clone::clone(__self_1),
},
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
ObligationCauseCode<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::Misc => ::core::fmt::Formatter::write_str(f, "Misc"),
Self::SliceOrArrayElem =>
::core::fmt::Formatter::write_str(f, "SliceOrArrayElem"),
Self::ArrayLen(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ArrayLen", &__self_0),
Self::TupleElem =>
::core::fmt::Formatter::write_str(f, "TupleElem"),
Self::WhereClause(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"WhereClause", __self_0, &__self_1),
Self::OpaqueTypeBound(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"OpaqueTypeBound", __self_0, &__self_1),
Self::WhereClauseInExpr(__self_0, __self_1, __self_2, __self_3) =>
::core::fmt::Formatter::debug_struct_field4_finish(f,
"WhereClauseInExpr", __self_0, __self_1, __self_2,
&__self_3),
Self::HostEffectInExpr(__self_0, __self_1, __self_2, __self_3) =>
::core::fmt::Formatter::debug_struct_field4_finish(f,
"HostEffectInExpr", __self_0, __self_1, __self_2,
&__self_3),
Self::ReferenceOutlivesReferent(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ReferenceOutlivesReferent", &__self_0),
Self::ObjectTypeBound(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"ObjectTypeBound", __self_0, &__self_1),
Self::Coercion { source: __self_0, target: __self_1 } =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"Coercion source target", __self_0, &__self_1),
Self::AssignmentLhsSized =>
::core::fmt::Formatter::write_str(f, "AssignmentLhsSized"),
Self::TupleInitializerSized =>
::core::fmt::Formatter::write_str(f, "TupleInitializerSized"),
Self::StructInitializerSized =>
::core::fmt::Formatter::write_str(f,
"StructInitializerSized"),
Self::VariableType(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"VariableType", &__self_0),
Self::SizedArgumentType(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SizedArgumentType", &__self_0),
Self::SizedReturnType =>
::core::fmt::Formatter::write_str(f, "SizedReturnType"),
Self::SizedCallReturnType(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SizedCallReturnType", &__self_0),
Self::SizedYieldType =>
::core::fmt::Formatter::write_str(f, "SizedYieldType"),
Self::InlineAsmSized =>
::core::fmt::Formatter::write_str(f, "InlineAsmSized"),
Self::SizedClosureCapture(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SizedClosureCapture", &__self_0),
Self::SizedCoroutineInterior(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SizedCoroutineInterior", &__self_0),
Self::RepeatElementCopy {
is_constable: __self_0, elt_span: __self_1 } =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"RepeatElementCopy is_constable elt_span", __self_0,
&__self_1),
Self::FieldSized {
adt_kind: __self_0, span: __self_1, last: __self_2 } =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"FieldSized adt_kind span last", __self_0, __self_1,
&__self_2),
Self::SizedConstOrStatic =>
::core::fmt::Formatter::write_str(f, "SizedConstOrStatic"),
Self::SharedStatic =>
::core::fmt::Formatter::write_str(f, "SharedStatic"),
Self::BuiltinDerived(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"BuiltinDerived", &__self_0),
Self::ImplDerived(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ImplDerived", &__self_0),
Self::WellFormedDerived(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"WellFormedDerived", &__self_0),
Self::ImplDerivedHost(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ImplDerivedHost", &__self_0),
Self::BuiltinDerivedHost(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"BuiltinDerivedHost", &__self_0),
Self::FunctionArg {
arg_hir_id: __self_0,
call_hir_id: __self_1,
parent_code: __self_2 } =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"FunctionArg arg_hir_id call_hir_id parent_code", __self_0,
__self_1, &__self_2),
Self::CompareImplItem {
impl_item_def_id: __self_0,
trait_item_def_id: __self_1,
kind: __self_2 } =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"CompareImplItem impl_item_def_id trait_item_def_id kind",
__self_0, __self_1, &__self_2),
Self::CheckAssociatedTypeBounds {
impl_item_def_id: __self_0, trait_item_def_id: __self_1 } =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"CheckAssociatedTypeBounds impl_item_def_id trait_item_def_id",
__self_0, &__self_1),
Self::ExprAssignable =>
::core::fmt::Formatter::write_str(f, "ExprAssignable"),
Self::MatchExpressionArm(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"MatchExpressionArm", &__self_0),
Self::Pattern {
span: __self_0, root_ty: __self_1, origin_expr: __self_2 } =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"Pattern span root_ty origin_expr", __self_0, __self_1,
&__self_2),
Self::IfExpression {
expr_id: __self_0,
tail_defines_return_position_impl_trait: __self_1 } =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"IfExpression expr_id tail_defines_return_position_impl_trait",
__self_0, &__self_1),
Self::IfExpressionWithNoElse =>
::core::fmt::Formatter::write_str(f,
"IfExpressionWithNoElse"),
Self::MainFunctionType =>
::core::fmt::Formatter::write_str(f, "MainFunctionType"),
Self::LangFunctionType(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"LangFunctionType", &__self_0),
Self::IntrinsicType =>
::core::fmt::Formatter::write_str(f, "IntrinsicType"),
Self::LetElse => ::core::fmt::Formatter::write_str(f, "LetElse"),
Self::MethodReceiver =>
::core::fmt::Formatter::write_str(f, "MethodReceiver"),
Self::ReturnNoExpression =>
::core::fmt::Formatter::write_str(f, "ReturnNoExpression"),
Self::ReturnValue(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ReturnValue", &__self_0),
Self::OpaqueReturnType(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"OpaqueReturnType", &__self_0),
Self::ReturnType =>
::core::fmt::Formatter::write_str(f, "ReturnType"),
Self::BlockTailExpression(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"BlockTailExpression", __self_0, &__self_1),
Self::TrivialBound =>
::core::fmt::Formatter::write_str(f, "TrivialBound"),
Self::AwaitableExpr(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"AwaitableExpr", &__self_0),
Self::ForLoopIterator(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ForLoopIterator", &__self_0),
Self::QuestionMark =>
::core::fmt::Formatter::write_str(f, "QuestionMark"),
Self::WellFormed(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"WellFormed", &__self_0),
Self::MatchImpl(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"MatchImpl", __self_0, &__self_1),
Self::UnOp { hir_id: __self_0 } =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnOp hir_id", &__self_0),
Self::BinOp {
lhs_hir_id: __self_0,
rhs_hir_id: __self_1,
rhs_span: __self_2,
rhs_is_lit: __self_3,
output_ty: __self_4 } =>
::core::fmt::Formatter::debug_struct_field5_finish(f,
"BinOp lhs_hir_id rhs_hir_id rhs_span rhs_is_lit output_ty",
__self_0, __self_1, __self_2, __self_3, &__self_4),
Self::AscribeUserTypeProvePredicate(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"AscribeUserTypeProvePredicate", __self_0, &__self_1),
Self::RustCall =>
::core::fmt::Formatter::write_str(f, "RustCall"),
Self::DynCompatible(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"DynCompatible", &__self_0),
Self::AlwaysApplicableImpl =>
::core::fmt::Formatter::write_str(f, "AlwaysApplicableImpl"),
Self::ConstParam(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ConstParam", &__self_0),
Self::ConstItemTy(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ConstItemTy", &__self_0),
Self::TypeAlias(__self_0, __self_1, __self_2) =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"TypeAlias", __self_0, __self_1, &__self_2),
Self::UnsizedNonPlaceExpr(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnsizedNonPlaceExpr", &__self_0),
Self::CompareEii { external_impl: __self_0, declaration: __self_1
} =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"CompareEii external_impl declaration", __self_0,
&__self_1),
}
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
ObligationCauseCode<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
ObligationCauseCode<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::ArrayLen(__self_0), Self::ArrayLen(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::WhereClause(__self_0, __self_1),
Self::WhereClause(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::OpaqueTypeBound(__self_0, __self_1),
Self::OpaqueTypeBound(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::WhereClauseInExpr(__self_0, __self_1, __self_2,
__self_3),
Self::WhereClauseInExpr(__arg1_0, __arg1_1, __arg1_2,
__arg1_3)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2 && __self_3 == __arg1_3,
(Self::HostEffectInExpr(__self_0, __self_1, __self_2,
__self_3),
Self::HostEffectInExpr(__arg1_0, __arg1_1, __arg1_2,
__arg1_3)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2 && __self_3 == __arg1_3,
(Self::ReferenceOutlivesReferent(__self_0),
Self::ReferenceOutlivesReferent(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::ObjectTypeBound(__self_0, __self_1),
Self::ObjectTypeBound(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::Coercion { source: __self_0, target: __self_1 },
Self::Coercion { source: __arg1_0, target: __arg1_1 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::VariableType(__self_0), Self::VariableType(__arg1_0))
=> __self_0 == __arg1_0,
(Self::SizedArgumentType(__self_0),
Self::SizedArgumentType(__arg1_0)) => __self_0 == __arg1_0,
(Self::SizedCallReturnType(__self_0),
Self::SizedCallReturnType(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::SizedClosureCapture(__self_0),
Self::SizedClosureCapture(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::SizedCoroutineInterior(__self_0),
Self::SizedCoroutineInterior(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::RepeatElementCopy {
is_constable: __self_0, elt_span: __self_1 },
Self::RepeatElementCopy {
is_constable: __arg1_0, elt_span: __arg1_1 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::FieldSized {
adt_kind: __self_0, span: __self_1, last: __self_2 },
Self::FieldSized {
adt_kind: __arg1_0, span: __arg1_1, last: __arg1_2 }) =>
__self_2 == __arg1_2 && __self_0 == __arg1_0 &&
__self_1 == __arg1_1,
(Self::BuiltinDerived(__self_0),
Self::BuiltinDerived(__arg1_0)) => __self_0 == __arg1_0,
(Self::ImplDerived(__self_0), Self::ImplDerived(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::WellFormedDerived(__self_0),
Self::WellFormedDerived(__arg1_0)) => __self_0 == __arg1_0,
(Self::ImplDerivedHost(__self_0),
Self::ImplDerivedHost(__arg1_0)) => __self_0 == __arg1_0,
(Self::BuiltinDerivedHost(__self_0),
Self::BuiltinDerivedHost(__arg1_0)) => __self_0 == __arg1_0,
(Self::FunctionArg {
arg_hir_id: __self_0,
call_hir_id: __self_1,
parent_code: __self_2 }, Self::FunctionArg {
arg_hir_id: __arg1_0,
call_hir_id: __arg1_1,
parent_code: __arg1_2 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::CompareImplItem {
impl_item_def_id: __self_0,
trait_item_def_id: __self_1,
kind: __self_2 }, Self::CompareImplItem {
impl_item_def_id: __arg1_0,
trait_item_def_id: __arg1_1,
kind: __arg1_2 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::CheckAssociatedTypeBounds {
impl_item_def_id: __self_0, trait_item_def_id: __self_1 },
Self::CheckAssociatedTypeBounds {
impl_item_def_id: __arg1_0, trait_item_def_id: __arg1_1 })
=> __self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::MatchExpressionArm(__self_0),
Self::MatchExpressionArm(__arg1_0)) => __self_0 == __arg1_0,
(Self::Pattern {
span: __self_0, root_ty: __self_1, origin_expr: __self_2 },
Self::Pattern {
span: __arg1_0, root_ty: __arg1_1, origin_expr: __arg1_2 })
=>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::IfExpression {
expr_id: __self_0,
tail_defines_return_position_impl_trait: __self_1 },
Self::IfExpression {
expr_id: __arg1_0,
tail_defines_return_position_impl_trait: __arg1_1 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::LangFunctionType(__self_0),
Self::LangFunctionType(__arg1_0)) => __self_0 == __arg1_0,
(Self::ReturnValue(__self_0), Self::ReturnValue(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::OpaqueReturnType(__self_0),
Self::OpaqueReturnType(__arg1_0)) => __self_0 == __arg1_0,
(Self::BlockTailExpression(__self_0, __self_1),
Self::BlockTailExpression(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::AwaitableExpr(__self_0), Self::AwaitableExpr(__arg1_0))
=> __self_0 == __arg1_0,
(Self::ForLoopIterator(__self_0),
Self::ForLoopIterator(__arg1_0)) => __self_0 == __arg1_0,
(Self::WellFormed(__self_0), Self::WellFormed(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::MatchImpl(__self_0, __self_1),
Self::MatchImpl(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::UnOp { hir_id: __self_0 }, Self::UnOp {
hir_id: __arg1_0 }) => __self_0 == __arg1_0,
(Self::BinOp {
lhs_hir_id: __self_0,
rhs_hir_id: __self_1,
rhs_span: __self_2,
rhs_is_lit: __self_3,
output_ty: __self_4 }, Self::BinOp {
lhs_hir_id: __arg1_0,
rhs_hir_id: __arg1_1,
rhs_span: __arg1_2,
rhs_is_lit: __arg1_3,
output_ty: __arg1_4 }) =>
__self_3 == __arg1_3 && __self_0 == __arg1_0 &&
__self_1 == __arg1_1 && __self_2 == __arg1_2 &&
__self_4 == __arg1_4,
(Self::AscribeUserTypeProvePredicate(__self_0, __self_1),
Self::AscribeUserTypeProvePredicate(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::DynCompatible(__self_0), Self::DynCompatible(__arg1_0))
=> __self_0 == __arg1_0,
(Self::ConstParam(__self_0), Self::ConstParam(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::ConstItemTy(__self_0), Self::ConstItemTy(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::TypeAlias(__self_0, __self_1, __self_2),
Self::TypeAlias(__arg1_0, __arg1_1, __arg1_2)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::UnsizedNonPlaceExpr(__self_0),
Self::UnsizedNonPlaceExpr(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::CompareEii {
external_impl: __self_0, declaration: __self_1 },
Self::CompareEii {
external_impl: __arg1_0, declaration: __arg1_1 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
_ => true,
}
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
ObligationCauseCode<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<DefId>;
let _: ::core::cmp::AssertParamIsEq<Span>;
let _: ::core::cmp::AssertParamIsEq<Option<LocalDefId>>;
let _: ::core::cmp::AssertParamIsEq<HirId>;
let _: ::core::cmp::AssertParamIsEq<usize>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ty::Region<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Option<HirId>>;
let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
let _: ::core::cmp::AssertParamIsEq<IsConstable>;
let _: ::core::cmp::AssertParamIsEq<AdtKind>;
let _: ::core::cmp::AssertParamIsEq<bool>;
let _: ::core::cmp::AssertParamIsEq<DerivedCause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Box<ImplDerivedCause<'tcx>>>;
let _: ::core::cmp::AssertParamIsEq<DerivedCause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Box<ImplDerivedHostCause<'tcx>>>;
let _: ::core::cmp::AssertParamIsEq<DerivedHostCause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ty::AssocKind>;
let _:
::core::cmp::AssertParamIsEq<Box<MatchExpressionArmCause<'tcx>>>;
let _: ::core::cmp::AssertParamIsEq<Option<Span>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Option<PatternOriginExpr>>;
let _: ::core::cmp::AssertParamIsEq<Option<LocalDefId>>;
let _: ::core::cmp::AssertParamIsEq<Symbol>;
let _: ::core::cmp::AssertParamIsEq<Option<(Ty<'tcx>, HirId)>>;
let _: ::core::cmp::AssertParamIsEq<hir::MatchSource>;
let _: ::core::cmp::AssertParamIsEq<WellFormedLoc>;
let _: ::core::cmp::AssertParamIsEq<ObligationCause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Option<Ty<'tcx>>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
ObligationCauseCode<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ObligationCauseCode::Misc =>
0u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SliceOrArrayElem =>
1u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ArrayLen(ref __binding_0) =>
2u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::TupleElem =>
3u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::WhereClause(ref __binding_0,
ref __binding_1) => 4u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
ref __binding_1) => 5u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) =>
6u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::HostEffectInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) =>
7u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
=> 8u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ObjectTypeBound(ref __binding_0,
ref __binding_1) => 9u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::Coercion {
source: ref __binding_0, target: ref __binding_1 } =>
10u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::AssignmentLhsSized =>
11u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::TupleInitializerSized =>
12u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::StructInitializerSized =>
13u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::VariableType(ref __binding_0) =>
14u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedArgumentType(ref __binding_0) =>
15u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedReturnType =>
16u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
17u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedYieldType =>
18u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::InlineAsmSized =>
19u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
20u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
=> 21u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::RepeatElementCopy {
is_constable: ref __binding_0, elt_span: ref __binding_1 }
=> 22u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::FieldSized {
adt_kind: ref __binding_0,
span: ref __binding_1,
last: ref __binding_2 } =>
23u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SizedConstOrStatic =>
24u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::SharedStatic =>
25u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::BuiltinDerived(ref __binding_0) =>
26u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ImplDerived(ref __binding_0) =>
27u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::WellFormedDerived(ref __binding_0) =>
28u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ImplDerivedHost(ref __binding_0) =>
29u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
30u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::FunctionArg {
arg_hir_id: ref __binding_0,
call_hir_id: ref __binding_1,
parent_code: ref __binding_2 } =>
31u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1,
kind: ref __binding_2 } =>
32u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1 } =>
33u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ExprAssignable =>
34u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
35u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::Pattern {
span: ref __binding_0,
root_ty: ref __binding_1,
origin_expr: ref __binding_2 } =>
36u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::IfExpression {
expr_id: ref __binding_0,
tail_defines_return_position_impl_trait: ref __binding_1 }
=> 37u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::IfExpressionWithNoElse =>
38u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::MainFunctionType =>
39u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::LangFunctionType(ref __binding_0) =>
40u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::IntrinsicType =>
41u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::LetElse =>
42u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::MethodReceiver =>
43u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ReturnNoExpression =>
44u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ReturnValue(ref __binding_0) =>
45u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::OpaqueReturnType(ref __binding_0) =>
46u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ReturnType =>
47u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::BlockTailExpression(ref __binding_0,
ref __binding_1) => 48u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::TrivialBound =>
49u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::AwaitableExpr(ref __binding_0) =>
50u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ForLoopIterator(ref __binding_0) =>
51u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::QuestionMark =>
52u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::WellFormed(ref __binding_0) =>
53u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::MatchImpl(ref __binding_0,
ref __binding_1) => 54u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::UnOp { hir_id: ref __binding_0 } =>
55u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::BinOp {
lhs_hir_id: ref __binding_0,
rhs_hir_id: ref __binding_1,
rhs_span: ref __binding_2,
rhs_is_lit: ref __binding_3,
output_ty: ref __binding_4 } =>
56u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
ref __binding_1) => 57u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::RustCall =>
58u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::DynCompatible(ref __binding_0) =>
59u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::AlwaysApplicableImpl =>
60u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ConstParam(ref __binding_0) =>
61u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::ConstItemTy(ref __binding_0) =>
62u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::TypeAlias(ref __binding_0,
ref __binding_1, ref __binding_2) =>
63u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
64u8.stable_hash(__hcx, __hasher),
ObligationCauseCode::CompareEii {
external_impl: ref __binding_0, declaration: ref __binding_1
} => 65u8.stable_hash(__hcx, __hasher),
}
match *self {
ObligationCauseCode::Misc => {}
ObligationCauseCode::SliceOrArrayElem => {}
ObligationCauseCode::ArrayLen(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::TupleElem => {}
ObligationCauseCode::WhereClause(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
{ __binding_3.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::HostEffectInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
{ __binding_3.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ObjectTypeBound(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::Coercion {
source: ref __binding_0, target: ref __binding_1 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::AssignmentLhsSized => {}
ObligationCauseCode::TupleInitializerSized => {}
ObligationCauseCode::StructInitializerSized => {}
ObligationCauseCode::VariableType(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::SizedReturnType => {}
ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
{
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::SizedYieldType => {}
ObligationCauseCode::InlineAsmSized => {}
ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
{
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::RepeatElementCopy {
is_constable: ref __binding_0, elt_span: ref __binding_1 }
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::FieldSized {
adt_kind: ref __binding_0,
span: ref __binding_1,
last: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::SizedConstOrStatic => {}
ObligationCauseCode::SharedStatic => {}
ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ImplDerived(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
{
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::FunctionArg {
arg_hir_id: ref __binding_0,
call_hir_id: ref __binding_1,
parent_code: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1,
kind: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ExprAssignable => {}
ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
{
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::Pattern {
span: ref __binding_0,
root_ty: ref __binding_1,
origin_expr: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::IfExpression {
expr_id: ref __binding_0,
tail_defines_return_position_impl_trait: ref __binding_1 }
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::IfExpressionWithNoElse => {}
ObligationCauseCode::MainFunctionType => {}
ObligationCauseCode::LangFunctionType(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::IntrinsicType => {}
ObligationCauseCode::LetElse => {}
ObligationCauseCode::MethodReceiver => {}
ObligationCauseCode::ReturnNoExpression => {}
ObligationCauseCode::ReturnValue(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ReturnType => {}
ObligationCauseCode::BlockTailExpression(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::TrivialBound => {}
ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::QuestionMark => {}
ObligationCauseCode::WellFormed(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::MatchImpl(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::BinOp {
lhs_hir_id: ref __binding_0,
rhs_hir_id: ref __binding_1,
rhs_span: ref __binding_2,
rhs_is_lit: ref __binding_3,
output_ty: ref __binding_4 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
{ __binding_3.stable_hash(__hcx, __hasher); }
{ __binding_4.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::RustCall => {}
ObligationCauseCode::DynCompatible(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::AlwaysApplicableImpl => {}
ObligationCauseCode::ConstParam(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::ConstItemTy(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::TypeAlias(ref __binding_0,
ref __binding_1, ref __binding_2) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
{
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ObligationCauseCode::CompareEii {
external_impl: ref __binding_0, declaration: ref __binding_1
} => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for ObligationCauseCode<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
ObligationCauseCode::Misc => { 0usize }
ObligationCauseCode::SliceOrArrayElem => { 1usize }
ObligationCauseCode::ArrayLen(ref __binding_0) => { 2usize }
ObligationCauseCode::TupleElem => { 3usize }
ObligationCauseCode::WhereClause(ref __binding_0,
ref __binding_1) => {
4usize
}
ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
ref __binding_1) => {
5usize
}
ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
6usize
}
ObligationCauseCode::HostEffectInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
7usize
}
ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
=> {
8usize
}
ObligationCauseCode::ObjectTypeBound(ref __binding_0,
ref __binding_1) => {
9usize
}
ObligationCauseCode::Coercion {
source: ref __binding_0, target: ref __binding_1 } => {
10usize
}
ObligationCauseCode::AssignmentLhsSized => { 11usize }
ObligationCauseCode::TupleInitializerSized => { 12usize }
ObligationCauseCode::StructInitializerSized => { 13usize }
ObligationCauseCode::VariableType(ref __binding_0) => {
14usize
}
ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
15usize
}
ObligationCauseCode::SizedReturnType => { 16usize }
ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
{
17usize
}
ObligationCauseCode::SizedYieldType => { 18usize }
ObligationCauseCode::InlineAsmSized => { 19usize }
ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
{
20usize
}
ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
=> {
21usize
}
ObligationCauseCode::RepeatElementCopy {
is_constable: ref __binding_0, elt_span: ref __binding_1 }
=> {
22usize
}
ObligationCauseCode::FieldSized {
adt_kind: ref __binding_0,
span: ref __binding_1,
last: ref __binding_2 } => {
23usize
}
ObligationCauseCode::SizedConstOrStatic => { 24usize }
ObligationCauseCode::SharedStatic => { 25usize }
ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
26usize
}
ObligationCauseCode::ImplDerived(ref __binding_0) => {
27usize
}
ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
28usize
}
ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
29usize
}
ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
{
30usize
}
ObligationCauseCode::FunctionArg {
arg_hir_id: ref __binding_0,
call_hir_id: ref __binding_1,
parent_code: ref __binding_2 } => {
31usize
}
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1,
kind: ref __binding_2 } => {
32usize
}
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1 } => {
33usize
}
ObligationCauseCode::ExprAssignable => { 34usize }
ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
{
35usize
}
ObligationCauseCode::Pattern {
span: ref __binding_0,
root_ty: ref __binding_1,
origin_expr: ref __binding_2 } => {
36usize
}
ObligationCauseCode::IfExpression {
expr_id: ref __binding_0,
tail_defines_return_position_impl_trait: ref __binding_1 }
=> {
37usize
}
ObligationCauseCode::IfExpressionWithNoElse => { 38usize }
ObligationCauseCode::MainFunctionType => { 39usize }
ObligationCauseCode::LangFunctionType(ref __binding_0) => {
40usize
}
ObligationCauseCode::IntrinsicType => { 41usize }
ObligationCauseCode::LetElse => { 42usize }
ObligationCauseCode::MethodReceiver => { 43usize }
ObligationCauseCode::ReturnNoExpression => { 44usize }
ObligationCauseCode::ReturnValue(ref __binding_0) => {
45usize
}
ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
46usize
}
ObligationCauseCode::ReturnType => { 47usize }
ObligationCauseCode::BlockTailExpression(ref __binding_0,
ref __binding_1) => {
48usize
}
ObligationCauseCode::TrivialBound => { 49usize }
ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
50usize
}
ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
51usize
}
ObligationCauseCode::QuestionMark => { 52usize }
ObligationCauseCode::WellFormed(ref __binding_0) => {
53usize
}
ObligationCauseCode::MatchImpl(ref __binding_0,
ref __binding_1) => {
54usize
}
ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
55usize
}
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 } => {
56usize
}
ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
ref __binding_1) => {
57usize
}
ObligationCauseCode::RustCall => { 58usize }
ObligationCauseCode::DynCompatible(ref __binding_0) => {
59usize
}
ObligationCauseCode::AlwaysApplicableImpl => { 60usize }
ObligationCauseCode::ConstParam(ref __binding_0) => {
61usize
}
ObligationCauseCode::ConstItemTy(ref __binding_0) => {
62usize
}
ObligationCauseCode::TypeAlias(ref __binding_0,
ref __binding_1, ref __binding_2) => {
63usize
}
ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
{
64usize
}
ObligationCauseCode::CompareEii {
external_impl: ref __binding_0, declaration: ref __binding_1
} => {
65usize
}
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
ObligationCauseCode::Misc => {}
ObligationCauseCode::SliceOrArrayElem => {}
ObligationCauseCode::ArrayLen(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::TupleElem => {}
ObligationCauseCode::WhereClause(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
}
ObligationCauseCode::HostEffectInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
}
ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
=> {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::ObjectTypeBound(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::Coercion {
source: ref __binding_0, target: ref __binding_1 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::AssignmentLhsSized => {}
ObligationCauseCode::TupleInitializerSized => {}
ObligationCauseCode::StructInitializerSized => {}
ObligationCauseCode::VariableType(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::SizedReturnType => {}
ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
{
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::SizedYieldType => {}
ObligationCauseCode::InlineAsmSized => {}
ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
{
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
=> {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::RepeatElementCopy {
is_constable: ref __binding_0, elt_span: ref __binding_1 }
=> {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::FieldSized {
adt_kind: ref __binding_0,
span: ref __binding_1,
last: ref __binding_2 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
ObligationCauseCode::SizedConstOrStatic => {}
ObligationCauseCode::SharedStatic => {}
ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::ImplDerived(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
{
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::FunctionArg {
arg_hir_id: ref __binding_0,
call_hir_id: ref __binding_1,
parent_code: ref __binding_2 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1,
kind: ref __binding_2 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::ExprAssignable => {}
ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
{
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::Pattern {
span: ref __binding_0,
root_ty: ref __binding_1,
origin_expr: ref __binding_2 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
ObligationCauseCode::IfExpression {
expr_id: ref __binding_0,
tail_defines_return_position_impl_trait: ref __binding_1 }
=> {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::IfExpressionWithNoElse => {}
ObligationCauseCode::MainFunctionType => {}
ObligationCauseCode::LangFunctionType(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::IntrinsicType => {}
ObligationCauseCode::LetElse => {}
ObligationCauseCode::MethodReceiver => {}
ObligationCauseCode::ReturnNoExpression => {}
ObligationCauseCode::ReturnValue(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::ReturnType => {}
ObligationCauseCode::BlockTailExpression(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::TrivialBound => {}
ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::QuestionMark => {}
ObligationCauseCode::WellFormed(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::MatchImpl(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::BinOp {
lhs_hir_id: ref __binding_0,
rhs_hir_id: ref __binding_1,
rhs_span: ref __binding_2,
rhs_is_lit: ref __binding_3,
output_ty: ref __binding_4 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_4,
__encoder);
}
ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
ObligationCauseCode::RustCall => {}
ObligationCauseCode::DynCompatible(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::AlwaysApplicableImpl => {}
ObligationCauseCode::ConstParam(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::ConstItemTy(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::TypeAlias(ref __binding_0,
ref __binding_1, ref __binding_2) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
{
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ObligationCauseCode::CompareEii {
external_impl: ref __binding_0, declaration: ref __binding_1
} => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
}
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for ObligationCauseCode<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => { ObligationCauseCode::Misc }
1usize => { ObligationCauseCode::SliceOrArrayElem }
2usize => {
ObligationCauseCode::ArrayLen(::rustc_serialize::Decodable::decode(__decoder))
}
3usize => { ObligationCauseCode::TupleElem }
4usize => {
ObligationCauseCode::WhereClause(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
5usize => {
ObligationCauseCode::OpaqueTypeBound(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
6usize => {
ObligationCauseCode::WhereClauseInExpr(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
7usize => {
ObligationCauseCode::HostEffectInExpr(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
8usize => {
ObligationCauseCode::ReferenceOutlivesReferent(::rustc_serialize::Decodable::decode(__decoder))
}
9usize => {
ObligationCauseCode::ObjectTypeBound(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
10usize => {
ObligationCauseCode::Coercion {
source: ::rustc_serialize::Decodable::decode(__decoder),
target: ::rustc_serialize::Decodable::decode(__decoder),
}
}
11usize => { ObligationCauseCode::AssignmentLhsSized }
12usize => { ObligationCauseCode::TupleInitializerSized }
13usize => { ObligationCauseCode::StructInitializerSized }
14usize => {
ObligationCauseCode::VariableType(::rustc_serialize::Decodable::decode(__decoder))
}
15usize => {
ObligationCauseCode::SizedArgumentType(::rustc_serialize::Decodable::decode(__decoder))
}
16usize => { ObligationCauseCode::SizedReturnType }
17usize => {
ObligationCauseCode::SizedCallReturnType(::rustc_serialize::Decodable::decode(__decoder))
}
18usize => { ObligationCauseCode::SizedYieldType }
19usize => { ObligationCauseCode::InlineAsmSized }
20usize => {
ObligationCauseCode::SizedClosureCapture(::rustc_serialize::Decodable::decode(__decoder))
}
21usize => {
ObligationCauseCode::SizedCoroutineInterior(::rustc_serialize::Decodable::decode(__decoder))
}
22usize => {
ObligationCauseCode::RepeatElementCopy {
is_constable: ::rustc_serialize::Decodable::decode(__decoder),
elt_span: ::rustc_serialize::Decodable::decode(__decoder),
}
}
23usize => {
ObligationCauseCode::FieldSized {
adt_kind: ::rustc_serialize::Decodable::decode(__decoder),
span: ::rustc_serialize::Decodable::decode(__decoder),
last: ::rustc_serialize::Decodable::decode(__decoder),
}
}
24usize => { ObligationCauseCode::SizedConstOrStatic }
25usize => { ObligationCauseCode::SharedStatic }
26usize => {
ObligationCauseCode::BuiltinDerived(::rustc_serialize::Decodable::decode(__decoder))
}
27usize => {
ObligationCauseCode::ImplDerived(::rustc_serialize::Decodable::decode(__decoder))
}
28usize => {
ObligationCauseCode::WellFormedDerived(::rustc_serialize::Decodable::decode(__decoder))
}
29usize => {
ObligationCauseCode::ImplDerivedHost(::rustc_serialize::Decodable::decode(__decoder))
}
30usize => {
ObligationCauseCode::BuiltinDerivedHost(::rustc_serialize::Decodable::decode(__decoder))
}
31usize => {
ObligationCauseCode::FunctionArg {
arg_hir_id: ::rustc_serialize::Decodable::decode(__decoder),
call_hir_id: ::rustc_serialize::Decodable::decode(__decoder),
parent_code: ::rustc_serialize::Decodable::decode(__decoder),
}
}
32usize => {
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
trait_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
kind: ::rustc_serialize::Decodable::decode(__decoder),
}
}
33usize => {
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
trait_item_def_id: ::rustc_serialize::Decodable::decode(__decoder),
}
}
34usize => { ObligationCauseCode::ExprAssignable }
35usize => {
ObligationCauseCode::MatchExpressionArm(::rustc_serialize::Decodable::decode(__decoder))
}
36usize => {
ObligationCauseCode::Pattern {
span: ::rustc_serialize::Decodable::decode(__decoder),
root_ty: ::rustc_serialize::Decodable::decode(__decoder),
origin_expr: ::rustc_serialize::Decodable::decode(__decoder),
}
}
37usize => {
ObligationCauseCode::IfExpression {
expr_id: ::rustc_serialize::Decodable::decode(__decoder),
tail_defines_return_position_impl_trait: ::rustc_serialize::Decodable::decode(__decoder),
}
}
38usize => { ObligationCauseCode::IfExpressionWithNoElse }
39usize => { ObligationCauseCode::MainFunctionType }
40usize => {
ObligationCauseCode::LangFunctionType(::rustc_serialize::Decodable::decode(__decoder))
}
41usize => { ObligationCauseCode::IntrinsicType }
42usize => { ObligationCauseCode::LetElse }
43usize => { ObligationCauseCode::MethodReceiver }
44usize => { ObligationCauseCode::ReturnNoExpression }
45usize => {
ObligationCauseCode::ReturnValue(::rustc_serialize::Decodable::decode(__decoder))
}
46usize => {
ObligationCauseCode::OpaqueReturnType(::rustc_serialize::Decodable::decode(__decoder))
}
47usize => { ObligationCauseCode::ReturnType }
48usize => {
ObligationCauseCode::BlockTailExpression(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
49usize => { ObligationCauseCode::TrivialBound }
50usize => {
ObligationCauseCode::AwaitableExpr(::rustc_serialize::Decodable::decode(__decoder))
}
51usize => {
ObligationCauseCode::ForLoopIterator(::rustc_serialize::Decodable::decode(__decoder))
}
52usize => { ObligationCauseCode::QuestionMark }
53usize => {
ObligationCauseCode::WellFormed(::rustc_serialize::Decodable::decode(__decoder))
}
54usize => {
ObligationCauseCode::MatchImpl(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
55usize => {
ObligationCauseCode::UnOp {
hir_id: ::rustc_serialize::Decodable::decode(__decoder),
}
}
56usize => {
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),
}
}
57usize => {
ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
58usize => { ObligationCauseCode::RustCall }
59usize => {
ObligationCauseCode::DynCompatible(::rustc_serialize::Decodable::decode(__decoder))
}
60usize => { ObligationCauseCode::AlwaysApplicableImpl }
61usize => {
ObligationCauseCode::ConstParam(::rustc_serialize::Decodable::decode(__decoder))
}
62usize => {
ObligationCauseCode::ConstItemTy(::rustc_serialize::Decodable::decode(__decoder))
}
63usize => {
ObligationCauseCode::TypeAlias(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
64usize => {
ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_serialize::Decodable::decode(__decoder))
}
65usize => {
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..66, actual {0}",
n));
}
}
}
}
};TyDecodable)]
182#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for ObligationCauseCode<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ObligationCauseCode::Misc => {}
ObligationCauseCode::SliceOrArrayElem => {}
ObligationCauseCode::ArrayLen(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::TupleElem => {}
ObligationCauseCode::WhereClause(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::OpaqueTypeBound(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::WhereClauseInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::HostEffectInExpr(ref __binding_0,
ref __binding_1, ref __binding_2, ref __binding_3) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ReferenceOutlivesReferent(ref __binding_0)
=> {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ObjectTypeBound(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::Coercion {
source: ref __binding_0, target: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::AssignmentLhsSized => {}
ObligationCauseCode::TupleInitializerSized => {}
ObligationCauseCode::StructInitializerSized => {}
ObligationCauseCode::VariableType(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::SizedArgumentType(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::SizedReturnType => {}
ObligationCauseCode::SizedCallReturnType(ref __binding_0) =>
{
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::SizedYieldType => {}
ObligationCauseCode::InlineAsmSized => {}
ObligationCauseCode::SizedClosureCapture(ref __binding_0) =>
{
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::SizedCoroutineInterior(ref __binding_0)
=> {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::RepeatElementCopy {
is_constable: ref __binding_0, elt_span: ref __binding_1 }
=> {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::FieldSized {
adt_kind: ref __binding_0,
span: ref __binding_1,
last: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::SizedConstOrStatic => {}
ObligationCauseCode::SharedStatic => {}
ObligationCauseCode::BuiltinDerived(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ImplDerived(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::WellFormedDerived(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ImplDerivedHost(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::BuiltinDerivedHost(ref __binding_0) =>
{
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::FunctionArg {
arg_hir_id: ref __binding_0,
call_hir_id: ref __binding_1,
parent_code: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1,
kind: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ref __binding_0,
trait_item_def_id: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ExprAssignable => {}
ObligationCauseCode::MatchExpressionArm(ref __binding_0) =>
{
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::Pattern {
span: ref __binding_0,
root_ty: ref __binding_1,
origin_expr: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::IfExpression {
expr_id: ref __binding_0,
tail_defines_return_position_impl_trait: ref __binding_1 }
=> {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::IfExpressionWithNoElse => {}
ObligationCauseCode::MainFunctionType => {}
ObligationCauseCode::LangFunctionType(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::IntrinsicType => {}
ObligationCauseCode::LetElse => {}
ObligationCauseCode::MethodReceiver => {}
ObligationCauseCode::ReturnNoExpression => {}
ObligationCauseCode::ReturnValue(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::OpaqueReturnType(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ReturnType => {}
ObligationCauseCode::BlockTailExpression(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::TrivialBound => {}
ObligationCauseCode::AwaitableExpr(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ForLoopIterator(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::QuestionMark => {}
ObligationCauseCode::WellFormed(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::MatchImpl(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::UnOp { hir_id: ref __binding_0 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::BinOp {
lhs_hir_id: ref __binding_0,
rhs_hir_id: ref __binding_1,
rhs_span: ref __binding_2,
rhs_is_lit: ref __binding_3,
output_ty: ref __binding_4 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_4,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::AscribeUserTypeProvePredicate(ref __binding_0,
ref __binding_1) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::RustCall => {}
ObligationCauseCode::DynCompatible(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::AlwaysApplicableImpl => {}
ObligationCauseCode::ConstParam(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::ConstItemTy(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::TypeAlias(ref __binding_0,
ref __binding_1, ref __binding_2) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::UnsizedNonPlaceExpr(ref __binding_0) =>
{
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
ObligationCauseCode::CompareEii {
external_impl: ref __binding_0, declaration: ref __binding_1
} => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for ObligationCauseCode<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ObligationCauseCode::Misc => { ObligationCauseCode::Misc }
ObligationCauseCode::SliceOrArrayElem => {
ObligationCauseCode::SliceOrArrayElem
}
ObligationCauseCode::ArrayLen(__binding_0) => {
ObligationCauseCode::ArrayLen(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::TupleElem => {
ObligationCauseCode::TupleElem
}
ObligationCauseCode::WhereClause(__binding_0, __binding_1)
=> {
ObligationCauseCode::WhereClause(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ObligationCauseCode::OpaqueTypeBound(__binding_0,
__binding_1) => {
ObligationCauseCode::OpaqueTypeBound(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ObligationCauseCode::WhereClauseInExpr(__binding_0,
__binding_1, __binding_2, __binding_3) => {
ObligationCauseCode::WhereClauseInExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
__folder)?)
}
ObligationCauseCode::HostEffectInExpr(__binding_0,
__binding_1, __binding_2, __binding_3) => {
ObligationCauseCode::HostEffectInExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
__folder)?)
}
ObligationCauseCode::ReferenceOutlivesReferent(__binding_0)
=> {
ObligationCauseCode::ReferenceOutlivesReferent(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::ObjectTypeBound(__binding_0,
__binding_1) => {
ObligationCauseCode::ObjectTypeBound(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ObligationCauseCode::Coercion {
source: __binding_0, target: __binding_1 } => {
ObligationCauseCode::Coercion {
source: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
target: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
ObligationCauseCode::AssignmentLhsSized => {
ObligationCauseCode::AssignmentLhsSized
}
ObligationCauseCode::TupleInitializerSized => {
ObligationCauseCode::TupleInitializerSized
}
ObligationCauseCode::StructInitializerSized => {
ObligationCauseCode::StructInitializerSized
}
ObligationCauseCode::VariableType(__binding_0) => {
ObligationCauseCode::VariableType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::SizedArgumentType(__binding_0) => {
ObligationCauseCode::SizedArgumentType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::SizedReturnType => {
ObligationCauseCode::SizedReturnType
}
ObligationCauseCode::SizedCallReturnType(__binding_0) => {
ObligationCauseCode::SizedCallReturnType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::SizedYieldType => {
ObligationCauseCode::SizedYieldType
}
ObligationCauseCode::InlineAsmSized => {
ObligationCauseCode::InlineAsmSized
}
ObligationCauseCode::SizedClosureCapture(__binding_0) => {
ObligationCauseCode::SizedClosureCapture(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::SizedCoroutineInterior(__binding_0) =>
{
ObligationCauseCode::SizedCoroutineInterior(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::RepeatElementCopy {
is_constable: __binding_0, elt_span: __binding_1 } => {
ObligationCauseCode::RepeatElementCopy {
is_constable: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
elt_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
ObligationCauseCode::FieldSized {
adt_kind: __binding_0, span: __binding_1, last: __binding_2
} => {
ObligationCauseCode::FieldSized {
adt_kind: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
last: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
}
}
ObligationCauseCode::SizedConstOrStatic => {
ObligationCauseCode::SizedConstOrStatic
}
ObligationCauseCode::SharedStatic => {
ObligationCauseCode::SharedStatic
}
ObligationCauseCode::BuiltinDerived(__binding_0) => {
ObligationCauseCode::BuiltinDerived(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::ImplDerived(__binding_0) => {
ObligationCauseCode::ImplDerived(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::WellFormedDerived(__binding_0) => {
ObligationCauseCode::WellFormedDerived(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::ImplDerivedHost(__binding_0) => {
ObligationCauseCode::ImplDerivedHost(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::BuiltinDerivedHost(__binding_0) => {
ObligationCauseCode::BuiltinDerivedHost(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::FunctionArg {
arg_hir_id: __binding_0,
call_hir_id: __binding_1,
parent_code: __binding_2 } => {
ObligationCauseCode::FunctionArg {
arg_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
call_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
parent_code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
}
}
ObligationCauseCode::CompareImplItem {
impl_item_def_id: __binding_0,
trait_item_def_id: __binding_1,
kind: __binding_2 } => {
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
trait_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
kind: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
}
}
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: __binding_0,
trait_item_def_id: __binding_1 } => {
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
trait_item_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
ObligationCauseCode::ExprAssignable => {
ObligationCauseCode::ExprAssignable
}
ObligationCauseCode::MatchExpressionArm(__binding_0) => {
ObligationCauseCode::MatchExpressionArm(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::Pattern {
span: __binding_0,
root_ty: __binding_1,
origin_expr: __binding_2 } => {
ObligationCauseCode::Pattern {
span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
root_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
origin_expr: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
}
}
ObligationCauseCode::IfExpression {
expr_id: __binding_0,
tail_defines_return_position_impl_trait: __binding_1 } => {
ObligationCauseCode::IfExpression {
expr_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
tail_defines_return_position_impl_trait: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
ObligationCauseCode::IfExpressionWithNoElse => {
ObligationCauseCode::IfExpressionWithNoElse
}
ObligationCauseCode::MainFunctionType => {
ObligationCauseCode::MainFunctionType
}
ObligationCauseCode::LangFunctionType(__binding_0) => {
ObligationCauseCode::LangFunctionType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::IntrinsicType => {
ObligationCauseCode::IntrinsicType
}
ObligationCauseCode::LetElse => {
ObligationCauseCode::LetElse
}
ObligationCauseCode::MethodReceiver => {
ObligationCauseCode::MethodReceiver
}
ObligationCauseCode::ReturnNoExpression => {
ObligationCauseCode::ReturnNoExpression
}
ObligationCauseCode::ReturnValue(__binding_0) => {
ObligationCauseCode::ReturnValue(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::OpaqueReturnType(__binding_0) => {
ObligationCauseCode::OpaqueReturnType(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::ReturnType => {
ObligationCauseCode::ReturnType
}
ObligationCauseCode::BlockTailExpression(__binding_0,
__binding_1) => {
ObligationCauseCode::BlockTailExpression(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ObligationCauseCode::TrivialBound => {
ObligationCauseCode::TrivialBound
}
ObligationCauseCode::AwaitableExpr(__binding_0) => {
ObligationCauseCode::AwaitableExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::ForLoopIterator(__binding_0) => {
ObligationCauseCode::ForLoopIterator(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::QuestionMark => {
ObligationCauseCode::QuestionMark
}
ObligationCauseCode::WellFormed(__binding_0) => {
ObligationCauseCode::WellFormed(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::MatchImpl(__binding_0, __binding_1) =>
{
ObligationCauseCode::MatchImpl(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ObligationCauseCode::UnOp { hir_id: __binding_0 } => {
ObligationCauseCode::UnOp {
hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
}
}
ObligationCauseCode::BinOp {
lhs_hir_id: __binding_0,
rhs_hir_id: __binding_1,
rhs_span: __binding_2,
rhs_is_lit: __binding_3,
output_ty: __binding_4 } => {
ObligationCauseCode::BinOp {
lhs_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
rhs_hir_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
rhs_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
rhs_is_lit: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
__folder)?,
output_ty: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_4,
__folder)?,
}
}
ObligationCauseCode::AscribeUserTypeProvePredicate(__binding_0,
__binding_1) => {
ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?)
}
ObligationCauseCode::RustCall => {
ObligationCauseCode::RustCall
}
ObligationCauseCode::DynCompatible(__binding_0) => {
ObligationCauseCode::DynCompatible(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::AlwaysApplicableImpl => {
ObligationCauseCode::AlwaysApplicableImpl
}
ObligationCauseCode::ConstParam(__binding_0) => {
ObligationCauseCode::ConstParam(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::ConstItemTy(__binding_0) => {
ObligationCauseCode::ConstItemTy(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::TypeAlias(__binding_0, __binding_1,
__binding_2) => {
ObligationCauseCode::TypeAlias(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?)
}
ObligationCauseCode::UnsizedNonPlaceExpr(__binding_0) => {
ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
ObligationCauseCode::CompareEii {
external_impl: __binding_0, declaration: __binding_1 } => {
ObligationCauseCode::CompareEii {
external_impl: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
declaration: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
ObligationCauseCode::Misc => { ObligationCauseCode::Misc }
ObligationCauseCode::SliceOrArrayElem => {
ObligationCauseCode::SliceOrArrayElem
}
ObligationCauseCode::ArrayLen(__binding_0) => {
ObligationCauseCode::ArrayLen(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::TupleElem => {
ObligationCauseCode::TupleElem
}
ObligationCauseCode::WhereClause(__binding_0, __binding_1)
=> {
ObligationCauseCode::WhereClause(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
ObligationCauseCode::OpaqueTypeBound(__binding_0,
__binding_1) => {
ObligationCauseCode::OpaqueTypeBound(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
ObligationCauseCode::WhereClauseInExpr(__binding_0,
__binding_1, __binding_2, __binding_3) => {
ObligationCauseCode::WhereClauseInExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
__folder))
}
ObligationCauseCode::HostEffectInExpr(__binding_0,
__binding_1, __binding_2, __binding_3) => {
ObligationCauseCode::HostEffectInExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
__folder))
}
ObligationCauseCode::ReferenceOutlivesReferent(__binding_0)
=> {
ObligationCauseCode::ReferenceOutlivesReferent(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::ObjectTypeBound(__binding_0,
__binding_1) => {
ObligationCauseCode::ObjectTypeBound(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
ObligationCauseCode::Coercion {
source: __binding_0, target: __binding_1 } => {
ObligationCauseCode::Coercion {
source: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
target: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
ObligationCauseCode::AssignmentLhsSized => {
ObligationCauseCode::AssignmentLhsSized
}
ObligationCauseCode::TupleInitializerSized => {
ObligationCauseCode::TupleInitializerSized
}
ObligationCauseCode::StructInitializerSized => {
ObligationCauseCode::StructInitializerSized
}
ObligationCauseCode::VariableType(__binding_0) => {
ObligationCauseCode::VariableType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::SizedArgumentType(__binding_0) => {
ObligationCauseCode::SizedArgumentType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::SizedReturnType => {
ObligationCauseCode::SizedReturnType
}
ObligationCauseCode::SizedCallReturnType(__binding_0) => {
ObligationCauseCode::SizedCallReturnType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::SizedYieldType => {
ObligationCauseCode::SizedYieldType
}
ObligationCauseCode::InlineAsmSized => {
ObligationCauseCode::InlineAsmSized
}
ObligationCauseCode::SizedClosureCapture(__binding_0) => {
ObligationCauseCode::SizedClosureCapture(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::SizedCoroutineInterior(__binding_0) =>
{
ObligationCauseCode::SizedCoroutineInterior(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::RepeatElementCopy {
is_constable: __binding_0, elt_span: __binding_1 } => {
ObligationCauseCode::RepeatElementCopy {
is_constable: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
elt_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
ObligationCauseCode::FieldSized {
adt_kind: __binding_0, span: __binding_1, last: __binding_2
} => {
ObligationCauseCode::FieldSized {
adt_kind: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
last: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
}
}
ObligationCauseCode::SizedConstOrStatic => {
ObligationCauseCode::SizedConstOrStatic
}
ObligationCauseCode::SharedStatic => {
ObligationCauseCode::SharedStatic
}
ObligationCauseCode::BuiltinDerived(__binding_0) => {
ObligationCauseCode::BuiltinDerived(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::ImplDerived(__binding_0) => {
ObligationCauseCode::ImplDerived(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::WellFormedDerived(__binding_0) => {
ObligationCauseCode::WellFormedDerived(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::ImplDerivedHost(__binding_0) => {
ObligationCauseCode::ImplDerivedHost(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::BuiltinDerivedHost(__binding_0) => {
ObligationCauseCode::BuiltinDerivedHost(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::FunctionArg {
arg_hir_id: __binding_0,
call_hir_id: __binding_1,
parent_code: __binding_2 } => {
ObligationCauseCode::FunctionArg {
arg_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
call_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
parent_code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
}
}
ObligationCauseCode::CompareImplItem {
impl_item_def_id: __binding_0,
trait_item_def_id: __binding_1,
kind: __binding_2 } => {
ObligationCauseCode::CompareImplItem {
impl_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
trait_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
kind: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
}
}
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: __binding_0,
trait_item_def_id: __binding_1 } => {
ObligationCauseCode::CheckAssociatedTypeBounds {
impl_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
trait_item_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
ObligationCauseCode::ExprAssignable => {
ObligationCauseCode::ExprAssignable
}
ObligationCauseCode::MatchExpressionArm(__binding_0) => {
ObligationCauseCode::MatchExpressionArm(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::Pattern {
span: __binding_0,
root_ty: __binding_1,
origin_expr: __binding_2 } => {
ObligationCauseCode::Pattern {
span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
root_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
origin_expr: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
}
}
ObligationCauseCode::IfExpression {
expr_id: __binding_0,
tail_defines_return_position_impl_trait: __binding_1 } => {
ObligationCauseCode::IfExpression {
expr_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
tail_defines_return_position_impl_trait: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
ObligationCauseCode::IfExpressionWithNoElse => {
ObligationCauseCode::IfExpressionWithNoElse
}
ObligationCauseCode::MainFunctionType => {
ObligationCauseCode::MainFunctionType
}
ObligationCauseCode::LangFunctionType(__binding_0) => {
ObligationCauseCode::LangFunctionType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::IntrinsicType => {
ObligationCauseCode::IntrinsicType
}
ObligationCauseCode::LetElse => {
ObligationCauseCode::LetElse
}
ObligationCauseCode::MethodReceiver => {
ObligationCauseCode::MethodReceiver
}
ObligationCauseCode::ReturnNoExpression => {
ObligationCauseCode::ReturnNoExpression
}
ObligationCauseCode::ReturnValue(__binding_0) => {
ObligationCauseCode::ReturnValue(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::OpaqueReturnType(__binding_0) => {
ObligationCauseCode::OpaqueReturnType(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::ReturnType => {
ObligationCauseCode::ReturnType
}
ObligationCauseCode::BlockTailExpression(__binding_0,
__binding_1) => {
ObligationCauseCode::BlockTailExpression(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
ObligationCauseCode::TrivialBound => {
ObligationCauseCode::TrivialBound
}
ObligationCauseCode::AwaitableExpr(__binding_0) => {
ObligationCauseCode::AwaitableExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::ForLoopIterator(__binding_0) => {
ObligationCauseCode::ForLoopIterator(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::QuestionMark => {
ObligationCauseCode::QuestionMark
}
ObligationCauseCode::WellFormed(__binding_0) => {
ObligationCauseCode::WellFormed(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::MatchImpl(__binding_0, __binding_1) =>
{
ObligationCauseCode::MatchImpl(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
ObligationCauseCode::UnOp { hir_id: __binding_0 } => {
ObligationCauseCode::UnOp {
hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
}
}
ObligationCauseCode::BinOp {
lhs_hir_id: __binding_0,
rhs_hir_id: __binding_1,
rhs_span: __binding_2,
rhs_is_lit: __binding_3,
output_ty: __binding_4 } => {
ObligationCauseCode::BinOp {
lhs_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
rhs_hir_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
rhs_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
rhs_is_lit: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
__folder),
output_ty: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_4,
__folder),
}
}
ObligationCauseCode::AscribeUserTypeProvePredicate(__binding_0,
__binding_1) => {
ObligationCauseCode::AscribeUserTypeProvePredicate(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder))
}
ObligationCauseCode::RustCall => {
ObligationCauseCode::RustCall
}
ObligationCauseCode::DynCompatible(__binding_0) => {
ObligationCauseCode::DynCompatible(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::AlwaysApplicableImpl => {
ObligationCauseCode::AlwaysApplicableImpl
}
ObligationCauseCode::ConstParam(__binding_0) => {
ObligationCauseCode::ConstParam(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::ConstItemTy(__binding_0) => {
ObligationCauseCode::ConstItemTy(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::TypeAlias(__binding_0, __binding_1,
__binding_2) => {
ObligationCauseCode::TypeAlias(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder))
}
ObligationCauseCode::UnsizedNonPlaceExpr(__binding_0) => {
ObligationCauseCode::UnsizedNonPlaceExpr(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
ObligationCauseCode::CompareEii {
external_impl: __binding_0, declaration: __binding_1 } => {
ObligationCauseCode::CompareEii {
external_impl: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
declaration: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable)]
183pub enum ObligationCauseCode<'tcx> {
184 Misc,
186
187 SliceOrArrayElem,
189
190 ArrayLen(Ty<'tcx>),
192
193 TupleElem,
195
196 WhereClause(DefId, Span),
199
200 OpaqueTypeBound(Span, Option<LocalDefId>),
204
205 WhereClauseInExpr(DefId, Span, HirId, usize),
210
211 HostEffectInExpr(DefId, Span, HirId, usize),
214
215 ReferenceOutlivesReferent(Ty<'tcx>),
217
218 ObjectTypeBound(Ty<'tcx>, ty::Region<'tcx>),
220
221 Coercion {
223 source: Ty<'tcx>,
224 target: Ty<'tcx>,
225 },
226
227 AssignmentLhsSized,
230 TupleInitializerSized,
232 StructInitializerSized,
234 VariableType(HirId),
236 SizedArgumentType(Option<HirId>),
238 SizedReturnType,
240 SizedCallReturnType(HirId),
242 SizedYieldType,
244 InlineAsmSized,
246 SizedClosureCapture(LocalDefId),
248 SizedCoroutineInterior(LocalDefId),
250 RepeatElementCopy {
252 is_constable: IsConstable,
255
256 elt_span: Span,
260 },
261
262 FieldSized {
264 adt_kind: AdtKind,
265 span: Span,
266 last: bool,
267 },
268
269 SizedConstOrStatic,
271
272 SharedStatic,
274
275 BuiltinDerived(DerivedCause<'tcx>),
278
279 ImplDerived(Box<ImplDerivedCause<'tcx>>),
282
283 WellFormedDerived(DerivedCause<'tcx>),
285
286 ImplDerivedHost(Box<ImplDerivedHostCause<'tcx>>),
289
290 BuiltinDerivedHost(DerivedHostCause<'tcx>),
293
294 FunctionArg {
297 arg_hir_id: HirId,
299 call_hir_id: HirId,
301 parent_code: ObligationCauseCodeHandle<'tcx>,
303 },
304
305 CompareImplItem {
308 impl_item_def_id: LocalDefId,
309 trait_item_def_id: DefId,
310 kind: ty::AssocKind,
311 },
312
313 CheckAssociatedTypeBounds {
315 impl_item_def_id: LocalDefId,
316 trait_item_def_id: DefId,
317 },
318
319 ExprAssignable,
321
322 MatchExpressionArm(Box<MatchExpressionArmCause<'tcx>>),
324
325 Pattern {
327 span: Option<Span>,
329 root_ty: Ty<'tcx>,
331 origin_expr: Option<PatternOriginExpr>,
333 },
334
335 IfExpression {
337 expr_id: HirId,
338 tail_defines_return_position_impl_trait: Option<LocalDefId>,
340 },
341
342 IfExpressionWithNoElse,
344
345 MainFunctionType,
347
348 LangFunctionType(Symbol),
350
351 IntrinsicType,
353
354 LetElse,
356
357 MethodReceiver,
359
360 ReturnNoExpression,
362
363 ReturnValue(HirId),
365
366 OpaqueReturnType(Option<(Ty<'tcx>, HirId)>),
368
369 ReturnType,
370
371 BlockTailExpression(HirId, hir::MatchSource),
373
374 TrivialBound,
376
377 AwaitableExpr(HirId),
378
379 ForLoopIterator(HirId),
380
381 QuestionMark,
382
383 WellFormed(WellFormedLoc),
390
391 MatchImpl(ObligationCause<'tcx>, DefId),
394
395 UnOp {
396 hir_id: HirId,
397 },
398
399 BinOp {
400 lhs_hir_id: HirId,
401 rhs_hir_id: HirId,
402 rhs_span: Span,
403 rhs_is_lit: bool,
404 output_ty: Option<Ty<'tcx>>,
405 },
406
407 AscribeUserTypeProvePredicate(Span, DefId),
408
409 RustCall,
410
411 DynCompatible(Span),
412
413 AlwaysApplicableImpl,
416
417 ConstParam(Ty<'tcx>),
419
420 ConstItemTy(Ty<'tcx>),
423
424 TypeAlias(ObligationCauseCodeHandle<'tcx>, Span, DefId),
426
427 UnsizedNonPlaceExpr(Span),
430
431 CompareEii {
434 external_impl: LocalDefId,
435 declaration: DefId,
436 },
437}
438
439#[derive(#[automatically_derived]impl ::core::marker::Copy for IsConstable { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
for IsConstable {
}
#[automatically_derived]impl ::core::clone::Clone for IsConstable {
#[inline]
fn clone(&self) -> Self { *self }
}Clone, #[automatically_derived]impl ::core::fmt::Debug for IsConstable {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
IsConstable::No => "No",
IsConstable::Fn => "Fn",
IsConstable::Ctor => "Ctor",
})
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
IsConstable {
}
#[automatically_derived]impl ::core::cmp::PartialEq for IsConstable {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other)
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for IsConstable { }Eq, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for IsConstable
{
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
IsConstable::No => 0u8.stable_hash(__hcx, __hasher),
IsConstable::Fn => 1u8.stable_hash(__hcx, __hasher),
IsConstable::Ctor => 2u8.stable_hash(__hcx, __hasher),
}
match *self {
IsConstable::No => {}
IsConstable::Fn => {}
IsConstable::Ctor => {}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for IsConstable {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
IsConstable::No => { 0usize }
IsConstable::Fn => { 1usize }
IsConstable::Ctor => { 2usize }
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for IsConstable {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => { IsConstable::No }
1usize => { IsConstable::Fn }
2usize => { IsConstable::Ctor }
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `IsConstable`, expected 0..3, actual {0}",
n));
}
}
}
}
};TyDecodable)]
442pub enum IsConstable {
443 No,
444 Fn,
446 Ctor,
448}
449
450#[derive(#[automatically_derived]impl ::core::marker::Copy for WellFormedLoc { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
for WellFormedLoc {
}
#[automatically_derived]impl ::core::clone::Clone for WellFormedLoc {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<LocalDefId>;
let _: ::core::clone::AssertParamIsClone<usize>;
let _: ::core::clone::AssertParamIsClone<HirId>;
*self
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for WellFormedLoc {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::Ty(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f, "Ty",
&__self_0),
Self::Param { function: __self_0, param_idx: __self_1 } =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"Param function param_idx", __self_0, &__self_1),
Self::HirId(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f, "HirId",
&__self_0),
Self::None => ::core::fmt::Formatter::write_str(f, "None"),
}
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
WellFormedLoc {
}
#[automatically_derived]impl ::core::cmp::PartialEq for WellFormedLoc {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::Ty(__self_0), Self::Ty(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Param { function: __self_0, param_idx: __self_1 },
Self::Param { function: __arg1_0, param_idx: __arg1_1 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
(Self::HirId(__self_0), Self::HirId(__arg1_0)) =>
__self_0 == __arg1_0,
_ => true,
}
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for WellFormedLoc {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<LocalDefId>;
let _: ::core::cmp::AssertParamIsEq<usize>;
let _: ::core::cmp::AssertParamIsEq<HirId>;
}
}Eq, #[automatically_derived]impl ::core::hash::Hash for WellFormedLoc {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
state);
match self {
Self::Ty(__self_0) => ::core::hash::Hash::hash(__self_0, state),
Self::Param { function: __self_0, param_idx: __self_1 } => {
::core::hash::Hash::hash(__self_0, state);
::core::hash::Hash::hash(__self_1, state)
}
Self::HirId(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
_ => {}
}
}
}Hash, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for
WellFormedLoc {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
WellFormedLoc::Ty(ref __binding_0) =>
0u8.stable_hash(__hcx, __hasher),
WellFormedLoc::Param {
function: ref __binding_0, param_idx: ref __binding_1 } =>
1u8.stable_hash(__hcx, __hasher),
WellFormedLoc::HirId(ref __binding_0) =>
2u8.stable_hash(__hcx, __hasher),
WellFormedLoc::None => 3u8.stable_hash(__hcx, __hasher),
}
match *self {
WellFormedLoc::Ty(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
WellFormedLoc::Param {
function: ref __binding_0, param_idx: ref __binding_1 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
WellFormedLoc::HirId(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
WellFormedLoc::None => {}
}
}
}
};StableHash, const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for WellFormedLoc {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
WellFormedLoc::Ty(ref __binding_0) => { 0usize }
WellFormedLoc::Param {
function: ref __binding_0, param_idx: ref __binding_1 } => {
1usize
}
WellFormedLoc::HirId(ref __binding_0) => { 2usize }
WellFormedLoc::None => { 3usize }
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
WellFormedLoc::Ty(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
WellFormedLoc::Param {
function: ref __binding_0, param_idx: ref __binding_1 } => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
WellFormedLoc::HirId(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
WellFormedLoc::None => {}
}
}
}
};Encodable, const _: () =
{
impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
for WellFormedLoc {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => {
WellFormedLoc::Ty(::rustc_serialize::Decodable::decode(__decoder))
}
1usize => {
WellFormedLoc::Param {
function: ::rustc_serialize::Decodable::decode(__decoder),
param_idx: ::rustc_serialize::Decodable::decode(__decoder),
}
}
2usize => {
WellFormedLoc::HirId(::rustc_serialize::Decodable::decode(__decoder))
}
3usize => { WellFormedLoc::None }
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `WellFormedLoc`, expected 0..4, actual {0}",
n));
}
}
}
}
};Decodable)]
455#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for WellFormedLoc {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
WellFormedLoc::Ty(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
WellFormedLoc::Param {
function: ref __binding_0, param_idx: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
WellFormedLoc::HirId(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
WellFormedLoc::None => {}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for WellFormedLoc {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
WellFormedLoc::Ty(__binding_0) => {
WellFormedLoc::Ty(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
WellFormedLoc::Param {
function: __binding_0, param_idx: __binding_1 } => {
WellFormedLoc::Param {
function: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
param_idx: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
WellFormedLoc::HirId(__binding_0) => {
WellFormedLoc::HirId(::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?)
}
WellFormedLoc::None => { WellFormedLoc::None }
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
WellFormedLoc::Ty(__binding_0) => {
WellFormedLoc::Ty(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
WellFormedLoc::Param {
function: __binding_0, param_idx: __binding_1 } => {
WellFormedLoc::Param {
function: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
param_idx: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
WellFormedLoc::HirId(__binding_0) => {
WellFormedLoc::HirId(::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder))
}
WellFormedLoc::None => { WellFormedLoc::None }
}
}
}
};TypeFoldable)]
456pub enum WellFormedLoc {
457 Ty(LocalDefId),
459 Param {
463 function: LocalDefId,
465 param_idx: usize,
469 },
470 HirId(HirId),
471 None,
472}
473
474impl<'tcx> ObligationCauseCode<'tcx> {
475 pub fn peel_derives(&self) -> &Self {
477 let mut base_cause = self;
478 while let Some(parent_code) = base_cause.parent() {
479 base_cause = parent_code;
480 }
481 base_cause
482 }
483
484 pub fn parent(&self) -> Option<&Self> {
485 match self {
486 ObligationCauseCode::FunctionArg { parent_code, .. } => Some(parent_code),
487 ObligationCauseCode::BuiltinDerived(derived)
488 | ObligationCauseCode::WellFormedDerived(derived)
489 | ObligationCauseCode::ImplDerived(ImplDerivedCause { derived, .. }) => {
490 Some(&derived.parent_code)
491 }
492 ObligationCauseCode::BuiltinDerivedHost(derived)
493 | ObligationCauseCode::ImplDerivedHost(ImplDerivedHostCause { derived, .. }) => {
494 Some(&derived.parent_code)
495 }
496 _ => None,
497 }
498 }
499
500 pub fn peel_derives_with_predicate(&self) -> (&Self, Option<ty::PolyTraitClause<'tcx>>) {
503 let mut base_cause = self;
504 let mut base_trait_pred = None;
505 while let Some((parent_code, parent_pred)) = base_cause.parent_with_predicate() {
506 base_cause = parent_code;
507 if let Some(parent_pred) = parent_pred {
508 base_trait_pred = Some(parent_pred);
509 }
510 }
511
512 (base_cause, base_trait_pred)
513 }
514
515 pub fn parent_with_predicate(&self) -> Option<(&Self, Option<ty::PolyTraitClause<'tcx>>)> {
516 match self {
517 ObligationCauseCode::FunctionArg { parent_code, .. } => Some((parent_code, None)),
518 ObligationCauseCode::BuiltinDerived(derived)
519 | ObligationCauseCode::WellFormedDerived(derived)
520 | ObligationCauseCode::ImplDerived(ImplDerivedCause { derived, .. }) => {
521 Some((&derived.parent_code, Some(derived.parent_trait_pred)))
522 }
523 _ => None,
524 }
525 }
526
527 pub fn peel_match_impls(&self) -> &Self {
528 match self {
529 ObligationCauseCode::MatchImpl(cause, _) => cause.code(),
530 _ => self,
531 }
532 }
533}
534
535#[cfg(target_pointer_width = "64")]
537const _: [(); 48] = [(); ::std::mem::size_of::<ObligationCauseCode<'_>>()];rustc_data_structures::static_assert_size!(ObligationCauseCode<'_>, 48);
538
539#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
MatchExpressionArmCause<'tcx> {
#[inline]
fn clone(&self) -> Self {
MatchExpressionArmCause {
arm_block_id: ::core::clone::Clone::clone(&self.arm_block_id),
arm_ty: ::core::clone::Clone::clone(&self.arm_ty),
arm_span: ::core::clone::Clone::clone(&self.arm_span),
prior_arm_block_id: ::core::clone::Clone::clone(&self.prior_arm_block_id),
prior_arm_ty: ::core::clone::Clone::clone(&self.prior_arm_ty),
prior_arm_span: ::core::clone::Clone::clone(&self.prior_arm_span),
scrut_span: ::core::clone::Clone::clone(&self.scrut_span),
source: ::core::clone::Clone::clone(&self.source),
expr_span: ::core::clone::Clone::clone(&self.expr_span),
prior_non_diverging_arms: ::core::clone::Clone::clone(&self.prior_non_diverging_arms),
tail_defines_return_position_impl_trait: ::core::clone::Clone::clone(&self.tail_defines_return_position_impl_trait),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
MatchExpressionArmCause<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
let names: &'static _ =
"MatchExpressionArmCause arm_block_id arm_ty arm_span prior_arm_block_id prior_arm_ty prior_arm_span scrut_span source expr_span prior_non_diverging_arms tail_defines_return_position_impl_trait";
let values: &[&dyn ::core::fmt::Debug] =
&[&self.arm_block_id, &self.arm_ty, &self.arm_span,
&self.prior_arm_block_id, &self.prior_arm_ty,
&self.prior_arm_span, &self.scrut_span, &self.source,
&self.expr_span, &self.prior_non_diverging_arms,
&&self.tail_defines_return_position_impl_trait];
::core::fmt::Formatter::debug_struct_fields_finish(f, names, values)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
MatchExpressionArmCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
MatchExpressionArmCause<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.arm_block_id == other.arm_block_id && self.arm_ty == other.arm_ty
&& self.arm_span == other.arm_span &&
self.prior_arm_block_id == other.prior_arm_block_id &&
self.prior_arm_ty == other.prior_arm_ty &&
self.prior_arm_span == other.prior_arm_span &&
self.scrut_span == other.scrut_span &&
self.source == other.source &&
self.expr_span == other.expr_span &&
self.prior_non_diverging_arms ==
other.prior_non_diverging_arms &&
self.tail_defines_return_position_impl_trait ==
other.tail_defines_return_position_impl_trait
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
MatchExpressionArmCause<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Option<HirId>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Span>;
let _: ::core::cmp::AssertParamIsEq<Option<HirId>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<hir::MatchSource>;
let _: ::core::cmp::AssertParamIsEq<Vec<Span>>;
let _: ::core::cmp::AssertParamIsEq<Option<LocalDefId>>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
MatchExpressionArmCause<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
MatchExpressionArmCause {
arm_block_id: ref __binding_0,
arm_ty: ref __binding_1,
arm_span: ref __binding_2,
prior_arm_block_id: ref __binding_3,
prior_arm_ty: ref __binding_4,
prior_arm_span: ref __binding_5,
scrut_span: ref __binding_6,
source: ref __binding_7,
expr_span: ref __binding_8,
prior_non_diverging_arms: ref __binding_9,
tail_defines_return_position_impl_trait: ref __binding_10 }
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
{ __binding_3.stable_hash(__hcx, __hasher); }
{ __binding_4.stable_hash(__hcx, __hasher); }
{ __binding_5.stable_hash(__hcx, __hasher); }
{ __binding_6.stable_hash(__hcx, __hasher); }
{ __binding_7.stable_hash(__hcx, __hasher); }
{ __binding_8.stable_hash(__hcx, __hasher); }
{ __binding_9.stable_hash(__hcx, __hasher); }
{ __binding_10.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for
MatchExpressionArmCause<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let MatchExpressionArmCause {
arm_block_id: ref __binding_0,
arm_ty: ref __binding_1,
arm_span: ref __binding_2,
prior_arm_block_id: ref __binding_3,
prior_arm_ty: ref __binding_4,
prior_arm_span: ref __binding_5,
scrut_span: ref __binding_6,
source: ref __binding_7,
expr_span: ref __binding_8,
prior_non_diverging_arms: ref __binding_9,
tail_defines_return_position_impl_trait: ref __binding_10
} = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_4,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_5,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_6,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_7,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_8,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_9,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_10,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for
MatchExpressionArmCause<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
MatchExpressionArmCause {
arm_block_id: ::rustc_serialize::Decodable::decode(__decoder),
arm_ty: ::rustc_serialize::Decodable::decode(__decoder),
arm_span: ::rustc_serialize::Decodable::decode(__decoder),
prior_arm_block_id: ::rustc_serialize::Decodable::decode(__decoder),
prior_arm_ty: ::rustc_serialize::Decodable::decode(__decoder),
prior_arm_span: ::rustc_serialize::Decodable::decode(__decoder),
scrut_span: ::rustc_serialize::Decodable::decode(__decoder),
source: ::rustc_serialize::Decodable::decode(__decoder),
expr_span: ::rustc_serialize::Decodable::decode(__decoder),
prior_non_diverging_arms: ::rustc_serialize::Decodable::decode(__decoder),
tail_defines_return_position_impl_trait: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
540#[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)]
541pub struct MatchExpressionArmCause<'tcx> {
542 pub arm_block_id: Option<HirId>,
543 pub arm_ty: Ty<'tcx>,
544 pub arm_span: Span,
545 pub prior_arm_block_id: Option<HirId>,
546 pub prior_arm_ty: Ty<'tcx>,
547 pub prior_arm_span: Span,
548 pub scrut_span: Span,
550 pub source: hir::MatchSource,
552 pub expr_span: Span,
554 pub prior_non_diverging_arms: Vec<Span>,
558 pub tail_defines_return_position_impl_trait: Option<LocalDefId>,
560}
561
562#[derive(#[automatically_derived]impl ::core::marker::Copy for PatternOriginExpr { }Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
for PatternOriginExpr {
}
#[automatically_derived]impl ::core::clone::Clone for PatternOriginExpr {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<Span>;
let _: ::core::clone::AssertParamIsClone<usize>;
let _: ::core::clone::AssertParamIsClone<bool>;
*self
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for PatternOriginExpr {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"PatternOriginExpr peeled_span peeled_count peeled_prefix_suggestion_parentheses",
&self.peeled_span, &self.peeled_count,
&&self.peeled_prefix_suggestion_parentheses)
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
PatternOriginExpr {
}
#[automatically_derived]impl ::core::cmp::PartialEq for PatternOriginExpr {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.peeled_prefix_suggestion_parentheses ==
other.peeled_prefix_suggestion_parentheses &&
self.peeled_span == other.peeled_span &&
self.peeled_count == other.peeled_count
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for PatternOriginExpr {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Span>;
let _: ::core::cmp::AssertParamIsEq<usize>;
let _: ::core::cmp::AssertParamIsEq<bool>;
}
}Eq)]
566#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for PatternOriginExpr {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
PatternOriginExpr {
peeled_span: __binding_0,
peeled_count: __binding_1,
peeled_prefix_suggestion_parentheses: __binding_2 } => {
PatternOriginExpr {
peeled_span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
peeled_count: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
peeled_prefix_suggestion_parentheses: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
PatternOriginExpr {
peeled_span: __binding_0,
peeled_count: __binding_1,
peeled_prefix_suggestion_parentheses: __binding_2 } => {
PatternOriginExpr {
peeled_span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
peeled_count: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
peeled_prefix_suggestion_parentheses: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
}
}
}
}
}
};TypeFoldable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for PatternOriginExpr {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
PatternOriginExpr {
peeled_span: ref __binding_0,
peeled_count: ref __binding_1,
peeled_prefix_suggestion_parentheses: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for
PatternOriginExpr {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
PatternOriginExpr {
peeled_span: ref __binding_0,
peeled_count: ref __binding_1,
peeled_prefix_suggestion_parentheses: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for PatternOriginExpr {
fn encode(&self, __encoder: &mut __E) {
let PatternOriginExpr {
peeled_span: ref __binding_0,
peeled_count: ref __binding_1,
peeled_prefix_suggestion_parentheses: ref __binding_2 } =
*self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for PatternOriginExpr {
fn decode(__decoder: &mut __D) -> Self {
PatternOriginExpr {
peeled_span: ::rustc_serialize::Decodable::decode(__decoder),
peeled_count: ::rustc_serialize::Decodable::decode(__decoder),
peeled_prefix_suggestion_parentheses: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
567pub struct PatternOriginExpr {
568 pub peeled_span: Span,
574 pub peeled_count: usize,
576 pub peeled_prefix_suggestion_parentheses: bool,
579}
580
581#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for DerivedCause<'tcx>
{
#[inline]
fn clone(&self) -> Self {
DerivedCause {
parent_trait_pred: ::core::clone::Clone::clone(&self.parent_trait_pred),
parent_code: ::core::clone::Clone::clone(&self.parent_code),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for DerivedCause<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"DerivedCause parent_trait_pred parent_code",
&self.parent_trait_pred, &&self.parent_code)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
DerivedCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
DerivedCause<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.parent_trait_pred == other.parent_trait_pred &&
self.parent_code == other.parent_code
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for DerivedCause<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<ty::PolyTraitClause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
DerivedCause<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
DerivedCause {
parent_trait_pred: ref __binding_0,
parent_code: ref __binding_1 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for DerivedCause<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let DerivedCause {
parent_trait_pred: ref __binding_0,
parent_code: ref __binding_1 } = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for DerivedCause<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
DerivedCause {
parent_trait_pred: ::rustc_serialize::Decodable::decode(__decoder),
parent_code: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
582#[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)]
583pub struct DerivedCause<'tcx> {
584 pub parent_trait_pred: ty::PolyTraitClause<'tcx>,
589
590 pub parent_code: ObligationCauseCodeHandle<'tcx>,
592}
593
594#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
ImplDerivedCause<'tcx> {
#[inline]
fn clone(&self) -> Self {
ImplDerivedCause {
derived: ::core::clone::Clone::clone(&self.derived),
impl_or_alias_def_id: ::core::clone::Clone::clone(&self.impl_or_alias_def_id),
impl_def_clause_index: ::core::clone::Clone::clone(&self.impl_def_clause_index),
span: ::core::clone::Clone::clone(&self.span),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
ImplDerivedCause<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field4_finish(f,
"ImplDerivedCause derived impl_or_alias_def_id impl_def_clause_index span",
&self.derived, &self.impl_or_alias_def_id,
&self.impl_def_clause_index, &&self.span)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
ImplDerivedCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
ImplDerivedCause<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.derived == other.derived &&
self.impl_or_alias_def_id == other.impl_or_alias_def_id &&
self.impl_def_clause_index == other.impl_def_clause_index &&
self.span == other.span
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for ImplDerivedCause<'tcx>
{
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<DerivedCause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<DefId>;
let _: ::core::cmp::AssertParamIsEq<Option<usize>>;
let _: ::core::cmp::AssertParamIsEq<Span>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
ImplDerivedCause<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ImplDerivedCause {
derived: ref __binding_0,
impl_or_alias_def_id: ref __binding_1,
impl_def_clause_index: ref __binding_2,
span: ref __binding_3 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
{ __binding_3.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for ImplDerivedCause<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let ImplDerivedCause {
derived: ref __binding_0,
impl_or_alias_def_id: ref __binding_1,
impl_def_clause_index: ref __binding_2,
span: ref __binding_3 } = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_3,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for ImplDerivedCause<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
ImplDerivedCause {
derived: ::rustc_serialize::Decodable::decode(__decoder),
impl_or_alias_def_id: ::rustc_serialize::Decodable::decode(__decoder),
impl_def_clause_index: ::rustc_serialize::Decodable::decode(__decoder),
span: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
595#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for ImplDerivedCause<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
ImplDerivedCause {
derived: ref __binding_0,
impl_or_alias_def_id: ref __binding_1,
impl_def_clause_index: ref __binding_2,
span: ref __binding_3 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_3,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for ImplDerivedCause<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
ImplDerivedCause {
derived: __binding_0,
impl_or_alias_def_id: __binding_1,
impl_def_clause_index: __binding_2,
span: __binding_3 } => {
ImplDerivedCause {
derived: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
impl_or_alias_def_id: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
impl_def_clause_index: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_2,
__folder)?,
span: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_3,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
ImplDerivedCause {
derived: __binding_0,
impl_or_alias_def_id: __binding_1,
impl_def_clause_index: __binding_2,
span: __binding_3 } => {
ImplDerivedCause {
derived: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
impl_or_alias_def_id: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
impl_def_clause_index: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_2,
__folder),
span: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_3,
__folder),
}
}
}
}
}
};TypeFoldable)]
596pub struct ImplDerivedCause<'tcx> {
597 pub derived: DerivedCause<'tcx>,
598 pub impl_or_alias_def_id: DefId,
603 pub impl_def_clause_index: Option<usize>,
605 pub span: Span,
606}
607
608#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
DerivedHostCause<'tcx> {
#[inline]
fn clone(&self) -> Self {
DerivedHostCause {
parent_host_clause: ::core::clone::Clone::clone(&self.parent_host_clause),
parent_code: ::core::clone::Clone::clone(&self.parent_code),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
DerivedHostCause<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field2_finish(f,
"DerivedHostCause parent_host_clause parent_code",
&self.parent_host_clause, &&self.parent_code)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
DerivedHostCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
DerivedHostCause<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.parent_host_clause == other.parent_host_clause &&
self.parent_code == other.parent_code
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for DerivedHostCause<'tcx>
{
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _:
::core::cmp::AssertParamIsEq<ty::Binder<'tcx,
ty::HostEffectClause<'tcx>>>;
let _: ::core::cmp::AssertParamIsEq<ObligationCauseCodeHandle<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
DerivedHostCause<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
DerivedHostCause {
parent_host_clause: ref __binding_0,
parent_code: ref __binding_1 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for DerivedHostCause<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let DerivedHostCause {
parent_host_clause: ref __binding_0,
parent_code: ref __binding_1 } = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for DerivedHostCause<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
DerivedHostCause {
parent_host_clause: ::rustc_serialize::Decodable::decode(__decoder),
parent_code: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
609#[derive(const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for DerivedHostCause<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
DerivedHostCause {
parent_host_clause: ref __binding_0,
parent_code: ref __binding_1 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeFoldable<::rustc_middle::ty::TyCtxt<'tcx>>
for DerivedHostCause<'tcx> {
fn try_fold_with<__F: ::rustc_middle::ty::FallibleTypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Result<Self, __F::Error> {
Ok(match self {
DerivedHostCause {
parent_host_clause: __binding_0, parent_code: __binding_1 }
=> {
DerivedHostCause {
parent_host_clause: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_0,
__folder)?,
parent_code: ::rustc_middle::ty::TypeFoldable::try_fold_with(__binding_1,
__folder)?,
}
}
})
}
fn fold_with<__F: ::rustc_middle::ty::TypeFolder<::rustc_middle::ty::TyCtxt<'tcx>>>(self,
__folder: &mut __F) -> Self {
match self {
DerivedHostCause {
parent_host_clause: __binding_0, parent_code: __binding_1 }
=> {
DerivedHostCause {
parent_host_clause: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_0,
__folder),
parent_code: ::rustc_middle::ty::TypeFoldable::fold_with(__binding_1,
__folder),
}
}
}
}
}
};TypeFoldable)]
610pub struct DerivedHostCause<'tcx> {
611 pub parent_host_clause: ty::Binder<'tcx, ty::HostEffectClause<'tcx>>,
616
617 pub parent_code: ObligationCauseCodeHandle<'tcx>,
619}
620
621#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
ImplDerivedHostCause<'tcx> {
#[inline]
fn clone(&self) -> Self {
ImplDerivedHostCause {
derived: ::core::clone::Clone::clone(&self.derived),
impl_def_id: ::core::clone::Clone::clone(&self.impl_def_id),
span: ::core::clone::Clone::clone(&self.span),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
ImplDerivedHostCause<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"ImplDerivedHostCause derived impl_def_id span", &self.derived,
&self.impl_def_id, &&self.span)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
ImplDerivedHostCause<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
ImplDerivedHostCause<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.derived == other.derived && self.impl_def_id == other.impl_def_id
&& self.span == other.span
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
ImplDerivedHostCause<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<DerivedHostCause<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<DefId>;
let _: ::core::cmp::AssertParamIsEq<Span>;
}
}Eq, const _: () =
{
impl<'tcx> ::rustc_data_structures::stable_hash::StableHash for
ImplDerivedHostCause<'tcx> {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ImplDerivedHostCause {
derived: ref __binding_0,
impl_def_id: ref __binding_1,
span: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for ImplDerivedHostCause<'tcx> {
fn encode(&self, __encoder: &mut __E) {
let ImplDerivedHostCause {
derived: ref __binding_0,
impl_def_id: ref __binding_1,
span: ref __binding_2 } = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for ImplDerivedHostCause<'tcx> {
fn decode(__decoder: &mut __D) -> Self {
ImplDerivedHostCause {
derived: ::rustc_serialize::Decodable::decode(__decoder),
impl_def_id: ::rustc_serialize::Decodable::decode(__decoder),
span: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable)]
622#[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)]
623pub struct ImplDerivedHostCause<'tcx> {
624 pub derived: DerivedHostCause<'tcx>,
625 pub impl_def_id: DefId,
627 pub span: Span,
628}
629
630#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
SelectionError<'tcx> {
#[inline]
fn clone(&self) -> Self {
match self {
Self::Unimplemented => SelectionError::Unimplemented,
Self::SignatureMismatch(__self_0) =>
SelectionError::SignatureMismatch(::core::clone::Clone::clone(__self_0)),
Self::TraitDynIncompatible(__self_0) =>
SelectionError::TraitDynIncompatible(::core::clone::Clone::clone(__self_0)),
Self::NotConstEvaluatable(__self_0) =>
SelectionError::NotConstEvaluatable(::core::clone::Clone::clone(__self_0)),
Self::Overflow(__self_0) =>
SelectionError::Overflow(::core::clone::Clone::clone(__self_0)),
Self::ConstArgHasWrongType {
ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 } =>
SelectionError::ConstArgHasWrongType {
ct: ::core::clone::Clone::clone(__self_0),
ct_ty: ::core::clone::Clone::clone(__self_1),
expected_ty: ::core::clone::Clone::clone(__self_2),
},
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for SelectionError<'tcx>
{
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::Unimplemented =>
::core::fmt::Formatter::write_str(f, "Unimplemented"),
Self::SignatureMismatch(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SignatureMismatch", &__self_0),
Self::TraitDynIncompatible(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"TraitDynIncompatible", &__self_0),
Self::NotConstEvaluatable(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"NotConstEvaluatable", &__self_0),
Self::Overflow(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"Overflow", &__self_0),
Self::ConstArgHasWrongType {
ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 } =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"ConstArgHasWrongType ct ct_ty expected_ty", __self_0,
__self_1, &__self_2),
}
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
SelectionError<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
SelectionError<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::SignatureMismatch(__self_0),
Self::SignatureMismatch(__arg1_0)) => __self_0 == __arg1_0,
(Self::TraitDynIncompatible(__self_0),
Self::TraitDynIncompatible(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::NotConstEvaluatable(__self_0),
Self::NotConstEvaluatable(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Overflow(__self_0), Self::Overflow(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::ConstArgHasWrongType {
ct: __self_0, ct_ty: __self_1, expected_ty: __self_2 },
Self::ConstArgHasWrongType {
ct: __arg1_0, ct_ty: __arg1_1, expected_ty: __arg1_2 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
_ => true,
}
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for SelectionError<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Box<SignatureMismatchData<'tcx>>>;
let _: ::core::cmp::AssertParamIsEq<DefId>;
let _: ::core::cmp::AssertParamIsEq<NotConstEvaluatable>;
let _: ::core::cmp::AssertParamIsEq<OverflowError>;
let _: ::core::cmp::AssertParamIsEq<ty::Const<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<Ty<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for SelectionError<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
SelectionError::Unimplemented => {}
SelectionError::SignatureMismatch(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
SelectionError::TraitDynIncompatible(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
SelectionError::NotConstEvaluatable(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
SelectionError::Overflow(ref __binding_0) => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
SelectionError::ConstArgHasWrongType {
ct: ref __binding_0,
ct_ty: ref __binding_1,
expected_ty: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
631pub enum SelectionError<'tcx> {
632 Unimplemented,
634 SignatureMismatch(Box<SignatureMismatchData<'tcx>>),
638 TraitDynIncompatible(DefId),
640 NotConstEvaluatable(NotConstEvaluatable),
642 Overflow(OverflowError),
644 ConstArgHasWrongType { ct: ty::Const<'tcx>, ct_ty: Ty<'tcx>, expected_ty: Ty<'tcx> },
646}
647
648#[derive(#[automatically_derived]impl<'tcx> ::core::clone::Clone for
SignatureMismatchData<'tcx> {
#[inline]
fn clone(&self) -> Self {
SignatureMismatchData {
found_trait_ref: ::core::clone::Clone::clone(&self.found_trait_ref),
expected_trait_ref: ::core::clone::Clone::clone(&self.expected_trait_ref),
terr: ::core::clone::Clone::clone(&self.terr),
}
}
}Clone, #[automatically_derived]impl<'tcx> ::core::fmt::Debug for
SignatureMismatchData<'tcx> {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field3_finish(f,
"SignatureMismatchData found_trait_ref expected_trait_ref terr",
&self.found_trait_ref, &self.expected_trait_ref, &&self.terr)
}
}Debug, #[automatically_derived]impl<'tcx> ::core::marker::StructuralPartialEq for
SignatureMismatchData<'tcx> {
}
#[automatically_derived]impl<'tcx> ::core::cmp::PartialEq for
SignatureMismatchData<'tcx> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.found_trait_ref == other.found_trait_ref &&
self.expected_trait_ref == other.expected_trait_ref &&
self.terr == other.terr
}
}PartialEq, #[automatically_derived]impl<'tcx> ::core::cmp::Eq for
SignatureMismatchData<'tcx> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<ty::TraitRef<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ty::TraitRef<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ty::error::TypeError<'tcx>>;
}
}Eq, const _: () =
{
impl<'tcx>
::rustc_middle::ty::TypeVisitable<::rustc_middle::ty::TyCtxt<'tcx>>
for SignatureMismatchData<'tcx> {
fn visit_with<__V: ::rustc_middle::ty::TypeVisitor<::rustc_middle::ty::TyCtxt<'tcx>>>(&self,
__visitor: &mut __V) -> __V::Result {
match *self {
SignatureMismatchData {
found_trait_ref: ref __binding_0,
expected_trait_ref: ref __binding_1,
terr: ref __binding_2 } => {
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_0,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_1,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
{
match ::rustc_middle::ty::VisitorResult::branch(::rustc_middle::ty::TypeVisitable::visit_with(__binding_2,
__visitor)) {
::core::ops::ControlFlow::Continue(()) => {}
::core::ops::ControlFlow::Break(r) => {
return ::rustc_middle::ty::VisitorResult::from_residual(r);
}
}
}
}
}
<__V::Result as ::rustc_middle::ty::VisitorResult>::output()
}
}
};TypeVisitable)]
649pub struct SignatureMismatchData<'tcx> {
650 pub found_trait_ref: ty::TraitRef<'tcx>,
651 pub expected_trait_ref: ty::TraitRef<'tcx>,
652 pub terr: ty::error::TypeError<'tcx>,
653}
654
655pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
663
664#[derive(#[automatically_derived]impl<'tcx, N: ::core::clone::Clone>
::core::clone::Clone for ImplSource<'tcx, N> {
#[inline]
fn clone(&self) -> Self {
match self {
Self::UserDefined(__self_0) =>
ImplSource::UserDefined(::core::clone::Clone::clone(__self_0)),
Self::Param(__self_0) =>
ImplSource::Param(::core::clone::Clone::clone(__self_0)),
Self::Builtin(__self_0, __self_1) =>
ImplSource::Builtin(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
}
}
}Clone, #[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
::core::marker::StructuralPartialEq for ImplSource<'tcx, N> {
}
#[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
::core::cmp::PartialEq for ImplSource<'tcx, N> {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::UserDefined(__self_0), Self::UserDefined(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Param(__self_0), Self::Param(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::Builtin(__self_0, __self_1),
Self::Builtin(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
_ => unsafe { ::core::intrinsics::unreachable() }
}
}
}PartialEq, #[automatically_derived]impl<'tcx, N: ::core::cmp::Eq> ::core::cmp::Eq for
ImplSource<'tcx, N> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _:
::core::cmp::AssertParamIsEq<ImplSourceUserDefinedData<'tcx,
N>>;
let _: ::core::cmp::AssertParamIsEq<ThinVec<N>>;
let _: ::core::cmp::AssertParamIsEq<BuiltinImplSource>;
let _: ::core::cmp::AssertParamIsEq<ThinVec<N>>;
}
}Eq, const _: () =
{
impl<'tcx, N, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for ImplSource<'tcx, N> where
ImplSourceUserDefinedData<'tcx,
N>: ::rustc_serialize::Encodable<__E>,
ThinVec<N>: ::rustc_serialize::Encodable<__E> {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
ImplSource::UserDefined(ref __binding_0) => { 0usize }
ImplSource::Param(ref __binding_0) => { 1usize }
ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
2usize
}
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
ImplSource::UserDefined(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ImplSource::Param(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
}
}
}
}
};TyEncodable, const _: () =
{
impl<'tcx, N, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for ImplSource<'tcx, N> where
ImplSourceUserDefinedData<'tcx,
N>: ::rustc_serialize::Decodable<__D>,
ThinVec<N>: ::rustc_serialize::Decodable<__D> {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => {
ImplSource::UserDefined(::rustc_serialize::Decodable::decode(__decoder))
}
1usize => {
ImplSource::Param(::rustc_serialize::Decodable::decode(__decoder))
}
2usize => {
ImplSource::Builtin(::rustc_serialize::Decodable::decode(__decoder),
::rustc_serialize::Decodable::decode(__decoder))
}
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `ImplSource`, expected 0..3, actual {0}",
n));
}
}
}
}
};TyDecodable, const _: () =
{
impl<'tcx, N> ::rustc_data_structures::stable_hash::StableHash for
ImplSource<'tcx, N> where
N: ::rustc_data_structures::stable_hash::StableHash {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ImplSource::UserDefined(ref __binding_0) =>
0u8.stable_hash(__hcx, __hasher),
ImplSource::Param(ref __binding_0) =>
1u8.stable_hash(__hcx, __hasher),
ImplSource::Builtin(ref __binding_0, ref __binding_1) =>
2u8.stable_hash(__hcx, __hasher),
}
match *self {
ImplSource::UserDefined(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ImplSource::Param(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
ImplSource::Builtin(ref __binding_0, ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash)]
694#[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)]
695pub enum ImplSource<'tcx, N> {
696 UserDefined(ImplSourceUserDefinedData<'tcx, N>),
698
699 Param(ThinVec<N>),
704
705 Builtin(BuiltinImplSource, ThinVec<N>),
707}
708
709impl<'tcx, N> ImplSource<'tcx, N> {
710 pub fn nested_obligations(self) -> ThinVec<N> {
711 match self {
712 ImplSource::UserDefined(i) => i.nested,
713 ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
714 }
715 }
716
717 pub fn borrow_nested_obligations(&self) -> &[N] {
718 match self {
719 ImplSource::UserDefined(i) => &i.nested,
720 ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
721 }
722 }
723
724 pub fn borrow_nested_obligations_mut(&mut self) -> &mut [N] {
725 match self {
726 ImplSource::UserDefined(i) => &mut i.nested,
727 ImplSource::Param(n) | ImplSource::Builtin(_, n) => n,
728 }
729 }
730
731 pub fn map<M, F>(self, f: F) -> ImplSource<'tcx, M>
732 where
733 F: FnMut(N) -> M,
734 {
735 match self {
736 ImplSource::UserDefined(i) => ImplSource::UserDefined(ImplSourceUserDefinedData {
737 impl_def_id: i.impl_def_id,
738 args: i.args,
739 nested: i.nested.into_iter().map(f).collect(),
740 }),
741 ImplSource::Param(n) => ImplSource::Param(n.into_iter().map(f).collect()),
742 ImplSource::Builtin(source, n) => {
743 ImplSource::Builtin(source, n.into_iter().map(f).collect())
744 }
745 }
746 }
747}
748
749#[derive(#[automatically_derived]impl<'tcx, N: ::core::clone::Clone>
::core::clone::Clone for ImplSourceUserDefinedData<'tcx, N> {
#[inline]
fn clone(&self) -> Self {
ImplSourceUserDefinedData {
impl_def_id: ::core::clone::Clone::clone(&self.impl_def_id),
args: ::core::clone::Clone::clone(&self.args),
nested: ::core::clone::Clone::clone(&self.nested),
}
}
}Clone, #[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
::core::marker::StructuralPartialEq for ImplSourceUserDefinedData<'tcx, N>
{
}
#[automatically_derived]impl<'tcx, N: ::core::cmp::PartialEq>
::core::cmp::PartialEq for ImplSourceUserDefinedData<'tcx, N> {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.impl_def_id == other.impl_def_id && self.args == other.args &&
self.nested == other.nested
}
}PartialEq, #[automatically_derived]impl<'tcx, N: ::core::cmp::Eq> ::core::cmp::Eq for
ImplSourceUserDefinedData<'tcx, N> {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<DefId>;
let _: ::core::cmp::AssertParamIsEq<GenericArgs<'tcx>>;
let _: ::core::cmp::AssertParamIsEq<ThinVec<N>>;
}
}Eq, const _: () =
{
impl<'tcx, N, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
::rustc_serialize::Encodable<__E> for
ImplSourceUserDefinedData<'tcx, N> where
ThinVec<N>: ::rustc_serialize::Encodable<__E> {
fn encode(&self, __encoder: &mut __E) {
let ImplSourceUserDefinedData {
impl_def_id: ref __binding_0,
args: ref __binding_1,
nested: ref __binding_2 } = *self;
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_1,
__encoder);
::rustc_serialize::Encodable::<__E>::encode(__binding_2,
__encoder);
}
}
};TyEncodable, const _: () =
{
impl<'tcx, N, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
::rustc_serialize::Decodable<__D> for
ImplSourceUserDefinedData<'tcx, N> where
ThinVec<N>: ::rustc_serialize::Decodable<__D> {
fn decode(__decoder: &mut __D) -> Self {
ImplSourceUserDefinedData {
impl_def_id: ::rustc_serialize::Decodable::decode(__decoder),
args: ::rustc_serialize::Decodable::decode(__decoder),
nested: ::rustc_serialize::Decodable::decode(__decoder),
}
}
}
};TyDecodable, const _: () =
{
impl<'tcx, N> ::rustc_data_structures::stable_hash::StableHash for
ImplSourceUserDefinedData<'tcx, N> where
N: ::rustc_data_structures::stable_hash::StableHash {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
ImplSourceUserDefinedData {
impl_def_id: ref __binding_0,
args: ref __binding_1,
nested: ref __binding_2 } => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash)]
760#[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)]
761pub struct ImplSourceUserDefinedData<'tcx, N> {
762 pub impl_def_id: DefId,
763 pub args: GenericArgs<'tcx>,
764 pub nested: ThinVec<N>,
765}
766
767#[derive(#[automatically_derived]impl ::core::clone::Clone for
DynCompatibilityViolation {
#[inline]
fn clone(&self) -> Self {
match self {
Self::ExplicitlyDynIncompatible(__self_0) =>
DynCompatibilityViolation::ExplicitlyDynIncompatible(::core::clone::Clone::clone(__self_0)),
Self::SizedSelf(__self_0) =>
DynCompatibilityViolation::SizedSelf(::core::clone::Clone::clone(__self_0)),
Self::SupertraitSelf(__self_0) =>
DynCompatibilityViolation::SupertraitSelf(::core::clone::Clone::clone(__self_0)),
Self::SupertraitNonLifetimeBinder(__self_0) =>
DynCompatibilityViolation::SupertraitNonLifetimeBinder(::core::clone::Clone::clone(__self_0)),
Self::SupertraitConst(__self_0) =>
DynCompatibilityViolation::SupertraitConst(::core::clone::Clone::clone(__self_0)),
Self::Method(__self_0, __self_1, __self_2) =>
DynCompatibilityViolation::Method(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1),
::core::clone::Clone::clone(__self_2)),
Self::AssocConst(__self_0, __self_1, __self_2) =>
DynCompatibilityViolation::AssocConst(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1),
::core::clone::Clone::clone(__self_2)),
Self::GenericAssocTy(__self_0, __self_1) =>
DynCompatibilityViolation::GenericAssocTy(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1)),
}
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for DynCompatibilityViolation
{
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::ExplicitlyDynIncompatible(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ExplicitlyDynIncompatible", &__self_0),
Self::SizedSelf(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SizedSelf", &__self_0),
Self::SupertraitSelf(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SupertraitSelf", &__self_0),
Self::SupertraitNonLifetimeBinder(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SupertraitNonLifetimeBinder", &__self_0),
Self::SupertraitConst(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"SupertraitConst", &__self_0),
Self::Method(__self_0, __self_1, __self_2) =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"Method", __self_0, __self_1, &__self_2),
Self::AssocConst(__self_0, __self_1, __self_2) =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"AssocConst", __self_0, __self_1, &__self_2),
Self::GenericAssocTy(__self_0, __self_1) =>
::core::fmt::Formatter::debug_struct_field2_finish(f,
"GenericAssocTy", __self_0, &__self_1),
}
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
DynCompatibilityViolation {
}
#[automatically_derived]impl ::core::cmp::PartialEq for
DynCompatibilityViolation {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::ExplicitlyDynIncompatible(__self_0),
Self::ExplicitlyDynIncompatible(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::SizedSelf(__self_0), Self::SizedSelf(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::SupertraitSelf(__self_0),
Self::SupertraitSelf(__arg1_0)) => __self_0 == __arg1_0,
(Self::SupertraitNonLifetimeBinder(__self_0),
Self::SupertraitNonLifetimeBinder(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::SupertraitConst(__self_0),
Self::SupertraitConst(__arg1_0)) => __self_0 == __arg1_0,
(Self::Method(__self_0, __self_1, __self_2),
Self::Method(__arg1_0, __arg1_1, __arg1_2)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::AssocConst(__self_0, __self_1, __self_2),
Self::AssocConst(__arg1_0, __arg1_1, __arg1_2)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::GenericAssocTy(__self_0, __self_1),
Self::GenericAssocTy(__arg1_0, __arg1_1)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1,
_ => unsafe { ::core::intrinsics::unreachable() }
}
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for DynCompatibilityViolation {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
let _: ::core::cmp::AssertParamIsEq<SmallVec<[Span; 1]>>;
let _: ::core::cmp::AssertParamIsEq<Symbol>;
let _: ::core::cmp::AssertParamIsEq<MethodViolation>;
let _: ::core::cmp::AssertParamIsEq<Span>;
let _: ::core::cmp::AssertParamIsEq<AssocConstViolation>;
}
}Eq, #[automatically_derived]impl ::core::hash::Hash for DynCompatibilityViolation
{
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
state);
match self {
Self::ExplicitlyDynIncompatible(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::SizedSelf(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::SupertraitSelf(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::SupertraitNonLifetimeBinder(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::SupertraitConst(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::Method(__self_0, __self_1, __self_2) => {
::core::hash::Hash::hash(__self_0, state);
::core::hash::Hash::hash(__self_1, state);
::core::hash::Hash::hash(__self_2, state)
}
Self::AssocConst(__self_0, __self_1, __self_2) => {
::core::hash::Hash::hash(__self_0, state);
::core::hash::Hash::hash(__self_1, state);
::core::hash::Hash::hash(__self_2, state)
}
Self::GenericAssocTy(__self_0, __self_1) => {
::core::hash::Hash::hash(__self_0, state);
::core::hash::Hash::hash(__self_1, state)
}
}
}
}Hash, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for
DynCompatibilityViolation {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
DynCompatibilityViolation::ExplicitlyDynIncompatible(ref __binding_0)
=> 0u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::SizedSelf(ref __binding_0) =>
1u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::SupertraitSelf(ref __binding_0)
=> 2u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::SupertraitNonLifetimeBinder(ref __binding_0)
=> 3u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::SupertraitConst(ref __binding_0)
=> 4u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::Method(ref __binding_0,
ref __binding_1, ref __binding_2) =>
5u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::AssocConst(ref __binding_0,
ref __binding_1, ref __binding_2) =>
6u8.stable_hash(__hcx, __hasher),
DynCompatibilityViolation::GenericAssocTy(ref __binding_0,
ref __binding_1) => 7u8.stable_hash(__hcx, __hasher),
}
match *self {
DynCompatibilityViolation::ExplicitlyDynIncompatible(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::SizedSelf(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::SupertraitSelf(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::SupertraitNonLifetimeBinder(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::SupertraitConst(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::Method(ref __binding_0,
ref __binding_1, ref __binding_2) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::AssocConst(ref __binding_0,
ref __binding_1, ref __binding_2) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
{ __binding_2.stable_hash(__hcx, __hasher); }
}
DynCompatibilityViolation::GenericAssocTy(ref __binding_0,
ref __binding_1) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
{ __binding_1.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash)]
768pub enum DynCompatibilityViolation {
769 ExplicitlyDynIncompatible(SmallVec<[Span; 1]>),
771
772 SizedSelf(SmallVec<[Span; 1]>),
774
775 SupertraitSelf(SmallVec<[Span; 1]>),
778
779 SupertraitNonLifetimeBinder(SmallVec<[Span; 1]>),
781
782 SupertraitConst(SmallVec<[Span; 1]>),
784
785 Method(Symbol, MethodViolation, Span),
787
788 AssocConst(Symbol, AssocConstViolation, Span),
790
791 GenericAssocTy(Symbol, Span),
793}
794
795impl DynCompatibilityViolation {
796 pub fn error_msg(&self) -> Cow<'static, str> {
797 match self {
801 Self::ExplicitlyDynIncompatible(_) => "it opted out of dyn-compatibility".into(),
802 Self::SizedSelf(_) => "it requires `Self: Sized`".into(),
803 Self::SupertraitSelf(spans) => {
804 if spans.iter().any(|sp| *sp != DUMMY_SP) {
805 "it uses `Self` as a type parameter".into()
806 } else {
807 "it cannot use `Self` as a type parameter in a supertrait or `where`-clause"
808 .into()
809 }
810 }
811 Self::SupertraitNonLifetimeBinder(_) => {
812 "where clause cannot reference non-lifetime `for<...>` variables".into()
813 }
814 Self::SupertraitConst(_) => "it cannot have a `const` supertrait".into(),
815 Self::Method(name, MethodViolation::StaticMethod(_), _) => {
816 ::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()
817 }
818 Self::Method(name, MethodViolation::ReferencesSelfInput(_), DUMMY_SP) => {
819 ::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()
820 }
821 Self::Method(name, MethodViolation::ReferencesSelfInput(_), _) => {
822 ::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()
823 }
824 Self::Method(name, MethodViolation::ReferencesSelfOutput, _) => {
825 ::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()
826 }
827 Self::Method(name, MethodViolation::ReferencesImplTraitInTrait(_), _) => {
828 ::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()
829 }
830 Self::Method(name, MethodViolation::AsyncFn, _) => {
831 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("method `{0}` is `async`", name))
})format!("method `{name}` is `async`").into()
832 }
833 Self::Method(name, MethodViolation::CVariadic, _) => {
834 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("method `{0}` is C-variadic", name))
})format!("method `{name}` is C-variadic").into()
835 }
836 Self::Method(name, MethodViolation::WhereClauseReferencesSelf, _) => {
837 ::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()
838 }
839 Self::Method(name, MethodViolation::Generic, _) => {
840 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("method `{0}` has generic type parameters",
name))
})format!("method `{name}` has generic type parameters").into()
841 }
842 Self::Method(name, MethodViolation::UndispatchableReceiver(_), _) => {
843 ::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()
844 }
845 Self::AssocConst(name, AssocConstViolation::FeatureNotEnabled, _) => {
846 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains associated const `{0}`",
name))
})format!("it contains associated const `{name}`").into()
847 }
848 Self::AssocConst(name, AssocConstViolation::NonType, _) => ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains associated const `{0}` that\'s not defined as `#[rustc_always_gca]`",
name))
})format!(
849 "it contains associated const `{name}` that's not defined as `#[rustc_always_gca]`"
850 )
851 .into(),
852 Self::AssocConst(name, AssocConstViolation::Generic, _) => {
853 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains generic associated const `{0}`",
name))
})format!("it contains generic associated const `{name}`").into()
854 }
855 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!(
856 "it contains associated const `{name}` whose type references the `Self` type"
857 )
858 .into(),
859 Self::GenericAssocTy(name, _) => {
860 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("it contains generic associated type `{0}`",
name))
})format!("it contains generic associated type `{name}`").into()
861 }
862 }
863 }
864
865 pub fn solution(&self) -> DynCompatibilityViolationSolution {
866 match self {
867 Self::ExplicitlyDynIncompatible(_)
868 | Self::SizedSelf(_)
869 | Self::SupertraitSelf(_)
870 | Self::SupertraitNonLifetimeBinder(..)
871 | Self::SupertraitConst(_) => DynCompatibilityViolationSolution::None,
872 Self::Method(
873 name,
874 MethodViolation::StaticMethod(Some(((add_s, add_sp), (make_s, make_sp)))),
875 _,
876 ) => DynCompatibilityViolationSolution::AddSelfOrMakeSized {
877 name: *name,
878 add_self_sugg: (add_s.clone(), OrdSpan(*add_sp)),
879 make_sized_sugg: (make_s.clone(), OrdSpan(*make_sp)),
880 },
881 Self::Method(name, MethodViolation::UndispatchableReceiver(Some((span, lt))), _) => {
882 DynCompatibilityViolationSolution::ChangeToRefSelf(*name, OrdSpan(*span), *lt)
883 }
884 Self::Method(name, ..) | Self::AssocConst(name, ..) | Self::GenericAssocTy(name, _) => {
885 DynCompatibilityViolationSolution::MoveToAnotherTrait(*name)
886 }
887 }
888 }
889
890 pub fn spans(&self) -> SmallVec<[Span; 1]> {
891 match self {
894 Self::ExplicitlyDynIncompatible(spans)
895 | Self::SizedSelf(spans)
896 | Self::SupertraitSelf(spans)
897 | Self::SupertraitNonLifetimeBinder(spans)
898 | Self::SupertraitConst(spans) => spans.clone(),
899 Self::Method(_, _, span)
900 | Self::AssocConst(_, _, span)
901 | Self::GenericAssocTy(_, span) => {
902 if *span != DUMMY_SP {
903 {
let count = 0usize + 1usize;
let mut vec = ::smallvec::SmallVec::new();
if count <= vec.inline_size() {
vec.push(*span);
vec
} else {
::smallvec::SmallVec::from_vec(::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
[*span])))
}
}smallvec![*span]
904 } else {
905 ::smallvec::SmallVec::new()smallvec![]
906 }
907 }
908 }
909 }
910}
911
912#[derive(#[automatically_derived]impl ::core::clone::Clone for
DynCompatibilityViolationSolution {
#[inline]
fn clone(&self) -> Self {
match self {
Self::None => DynCompatibilityViolationSolution::None,
Self::AddSelfOrMakeSized {
name: __self_0,
add_self_sugg: __self_1,
make_sized_sugg: __self_2 } =>
DynCompatibilityViolationSolution::AddSelfOrMakeSized {
name: ::core::clone::Clone::clone(__self_0),
add_self_sugg: ::core::clone::Clone::clone(__self_1),
make_sized_sugg: ::core::clone::Clone::clone(__self_2),
},
Self::ChangeToRefSelf(__self_0, __self_1, __self_2) =>
DynCompatibilityViolationSolution::ChangeToRefSelf(::core::clone::Clone::clone(__self_0),
::core::clone::Clone::clone(__self_1),
::core::clone::Clone::clone(__self_2)),
Self::MoveToAnotherTrait(__self_0) =>
DynCompatibilityViolationSolution::MoveToAnotherTrait(::core::clone::Clone::clone(__self_0)),
}
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for
DynCompatibilityViolationSolution {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::None => ::core::fmt::Formatter::write_str(f, "None"),
Self::AddSelfOrMakeSized {
name: __self_0,
add_self_sugg: __self_1,
make_sized_sugg: __self_2 } =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"AddSelfOrMakeSized name add_self_sugg make_sized_sugg",
__self_0, __self_1, &__self_2),
Self::ChangeToRefSelf(__self_0, __self_1, __self_2) =>
::core::fmt::Formatter::debug_struct_field3_finish(f,
"ChangeToRefSelf", __self_0, __self_1, &__self_2),
Self::MoveToAnotherTrait(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"MoveToAnotherTrait", &__self_0),
}
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
DynCompatibilityViolationSolution {
}
#[automatically_derived]impl ::core::cmp::PartialEq for
DynCompatibilityViolationSolution {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::AddSelfOrMakeSized {
name: __self_0,
add_self_sugg: __self_1,
make_sized_sugg: __self_2 }, Self::AddSelfOrMakeSized {
name: __arg1_0,
add_self_sugg: __arg1_1,
make_sized_sugg: __arg1_2 }) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::ChangeToRefSelf(__self_0, __self_1, __self_2),
Self::ChangeToRefSelf(__arg1_0, __arg1_1, __arg1_2)) =>
__self_0 == __arg1_0 && __self_1 == __arg1_1 &&
__self_2 == __arg1_2,
(Self::MoveToAnotherTrait(__self_0),
Self::MoveToAnotherTrait(__arg1_0)) => __self_0 == __arg1_0,
_ => true,
}
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for
DynCompatibilityViolationSolution {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _: ::core::cmp::AssertParamIsEq<Symbol>;
let _: ::core::cmp::AssertParamIsEq<(String, OrdSpan)>;
let _: ::core::cmp::AssertParamIsEq<(String, OrdSpan)>;
let _: ::core::cmp::AssertParamIsEq<OrdSpan>;
}
}Eq, #[automatically_derived]impl ::core::cmp::PartialOrd for
DynCompatibilityViolationSolution {
#[inline]
fn partial_cmp(&self, other: &Self)
-> ::core::option::Option<::core::cmp::Ordering> {
::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
}
}PartialOrd, #[automatically_derived]impl ::core::cmp::Ord for
DynCompatibilityViolationSolution {
#[inline]
fn cmp(&self, other: &Self) -> ::core::cmp::Ordering {
match (self, other) {
(Self::AddSelfOrMakeSized {
name: __self_0,
add_self_sugg: __self_1,
make_sized_sugg: __self_2 }, Self::AddSelfOrMakeSized {
name: __arg1_0,
add_self_sugg: __arg1_1,
make_sized_sugg: __arg1_2 }) =>
match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
::core::cmp::Ordering::Equal =>
match ::core::cmp::Ord::cmp(__self_1, __arg1_1) {
::core::cmp::Ordering::Equal =>
::core::cmp::Ord::cmp(__self_2, __arg1_2),
cmp => cmp,
},
cmp => cmp,
},
(Self::ChangeToRefSelf(__self_0, __self_1, __self_2),
Self::ChangeToRefSelf(__arg1_0, __arg1_1, __arg1_2)) =>
match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
::core::cmp::Ordering::Equal =>
match ::core::cmp::Ord::cmp(__self_1, __arg1_1) {
::core::cmp::Ordering::Equal =>
::core::cmp::Ord::cmp(__self_2, __arg1_2),
cmp => cmp,
},
cmp => cmp,
},
(Self::MoveToAnotherTrait(__self_0),
Self::MoveToAnotherTrait(__arg1_0)) =>
::core::cmp::Ord::cmp(__self_0, __arg1_0),
_ =>
::core::cmp::Ord::cmp(&::core::intrinsics::discriminant_value(self),
&::core::intrinsics::discriminant_value(other)),
}
}
}Ord)]
913pub enum DynCompatibilityViolationSolution {
914 None,
915 AddSelfOrMakeSized {
916 name: Symbol,
917 add_self_sugg: (String, OrdSpan),
918 make_sized_sugg: (String, OrdSpan),
919 },
920 ChangeToRefSelf(Symbol, OrdSpan, Symbol),
921 MoveToAnotherTrait(Symbol),
922}
923
924impl DynCompatibilityViolationSolution {
925 pub fn add_to(self, err: &mut Diag<'_>) {
926 match self {
927 DynCompatibilityViolationSolution::None => {}
928 DynCompatibilityViolationSolution::AddSelfOrMakeSized {
929 name,
930 add_self_sugg,
931 make_sized_sugg,
932 } => {
933 err.span_suggestion_verbose(
934 add_self_sugg.1.0,
935 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("consider turning `{0}` into a method by giving it a `&self` argument, so that it is accessible through the trait object\'s vtable",
name))
})format!(
936 "consider turning `{name}` into a method by giving it a `&self` argument, \
937 so that it is accessible through the trait object's vtable",
938 ),
939 add_self_sugg.0,
940 Applicability::MaybeIncorrect,
941 );
942 err.span_suggestion_verbose(
943 make_sized_sugg.1.0,
944 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("alternatively, consider constraining `{0}` so it is explicitly marked as not applying to trait objects",
name))
})format!(
945 "alternatively, consider constraining `{name}` so it is explicitly marked \
946 as not applying to trait objects",
947 ),
948 make_sized_sugg.0,
949 Applicability::MaybeIncorrect,
950 );
951 }
952 DynCompatibilityViolationSolution::ChangeToRefSelf(name, span, lt) => {
953 err.span_suggestion_verbose(
954 span.0,
955 ::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`"),
956 ::alloc::__export::must_use({
::alloc::fmt::format(format_args!("&{1}{0}self",
if lt != sym::empty { " " } else { "" }, lt))
})format!("&{lt}{}self", if lt != sym::empty { " " } else { "" }),
957 Applicability::MachineApplicable,
958 );
959 }
960 DynCompatibilityViolationSolution::MoveToAnotherTrait(name) => {
961 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"));
962 }
963 }
964 }
965}
966
967#[derive(#[automatically_derived]impl ::core::clone::Clone for MethodViolation {
#[inline]
fn clone(&self) -> Self {
match self {
Self::StaticMethod(__self_0) =>
MethodViolation::StaticMethod(::core::clone::Clone::clone(__self_0)),
Self::ReferencesSelfInput(__self_0) =>
MethodViolation::ReferencesSelfInput(::core::clone::Clone::clone(__self_0)),
Self::ReferencesSelfOutput =>
MethodViolation::ReferencesSelfOutput,
Self::ReferencesImplTraitInTrait(__self_0) =>
MethodViolation::ReferencesImplTraitInTrait(::core::clone::Clone::clone(__self_0)),
Self::AsyncFn => MethodViolation::AsyncFn,
Self::WhereClauseReferencesSelf =>
MethodViolation::WhereClauseReferencesSelf,
Self::Generic => MethodViolation::Generic,
Self::CVariadic => MethodViolation::CVariadic,
Self::UndispatchableReceiver(__self_0) =>
MethodViolation::UndispatchableReceiver(::core::clone::Clone::clone(__self_0)),
}
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for MethodViolation {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::StaticMethod(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"StaticMethod", &__self_0),
Self::ReferencesSelfInput(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ReferencesSelfInput", &__self_0),
Self::ReferencesSelfOutput =>
::core::fmt::Formatter::write_str(f, "ReferencesSelfOutput"),
Self::ReferencesImplTraitInTrait(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"ReferencesImplTraitInTrait", &__self_0),
Self::AsyncFn => ::core::fmt::Formatter::write_str(f, "AsyncFn"),
Self::WhereClauseReferencesSelf =>
::core::fmt::Formatter::write_str(f,
"WhereClauseReferencesSelf"),
Self::Generic => ::core::fmt::Formatter::write_str(f, "Generic"),
Self::CVariadic =>
::core::fmt::Formatter::write_str(f, "CVariadic"),
Self::UndispatchableReceiver(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UndispatchableReceiver", &__self_0),
}
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
MethodViolation {
}
#[automatically_derived]impl ::core::cmp::PartialEq for MethodViolation {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other) &&
match (self, other) {
(Self::StaticMethod(__self_0), Self::StaticMethod(__arg1_0))
=> __self_0 == __arg1_0,
(Self::ReferencesSelfInput(__self_0),
Self::ReferencesSelfInput(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::ReferencesImplTraitInTrait(__self_0),
Self::ReferencesImplTraitInTrait(__arg1_0)) =>
__self_0 == __arg1_0,
(Self::UndispatchableReceiver(__self_0),
Self::UndispatchableReceiver(__arg1_0)) =>
__self_0 == __arg1_0,
_ => true,
}
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for MethodViolation {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_fields_are_eq(&self) {
let _:
::core::cmp::AssertParamIsEq<Option<((String, Span),
(String, Span))>>;
let _: ::core::cmp::AssertParamIsEq<Option<Span>>;
let _: ::core::cmp::AssertParamIsEq<Span>;
let _: ::core::cmp::AssertParamIsEq<Option<(Span, Symbol)>>;
}
}Eq, #[automatically_derived]impl ::core::hash::Hash for MethodViolation {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
state);
match self {
Self::StaticMethod(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::ReferencesSelfInput(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::ReferencesImplTraitInTrait(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
Self::UndispatchableReceiver(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
_ => {}
}
}
}Hash, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for
MethodViolation {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
MethodViolation::StaticMethod(ref __binding_0) =>
0u8.stable_hash(__hcx, __hasher),
MethodViolation::ReferencesSelfInput(ref __binding_0) =>
1u8.stable_hash(__hcx, __hasher),
MethodViolation::ReferencesSelfOutput =>
2u8.stable_hash(__hcx, __hasher),
MethodViolation::ReferencesImplTraitInTrait(ref __binding_0)
=> 3u8.stable_hash(__hcx, __hasher),
MethodViolation::AsyncFn =>
4u8.stable_hash(__hcx, __hasher),
MethodViolation::WhereClauseReferencesSelf =>
5u8.stable_hash(__hcx, __hasher),
MethodViolation::Generic =>
6u8.stable_hash(__hcx, __hasher),
MethodViolation::CVariadic =>
7u8.stable_hash(__hcx, __hasher),
MethodViolation::UndispatchableReceiver(ref __binding_0) =>
8u8.stable_hash(__hcx, __hasher),
}
match *self {
MethodViolation::StaticMethod(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
MethodViolation::ReferencesSelfInput(ref __binding_0) => {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
MethodViolation::ReferencesSelfOutput => {}
MethodViolation::ReferencesImplTraitInTrait(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
MethodViolation::AsyncFn => {}
MethodViolation::WhereClauseReferencesSelf => {}
MethodViolation::Generic => {}
MethodViolation::CVariadic => {}
MethodViolation::UndispatchableReceiver(ref __binding_0) =>
{
{ __binding_0.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash)]
969pub enum MethodViolation {
970 StaticMethod(Option<((String, Span), (String, Span))>),
972
973 ReferencesSelfInput(Option<Span>),
975
976 ReferencesSelfOutput,
978
979 ReferencesImplTraitInTrait(Span),
981
982 AsyncFn,
984
985 WhereClauseReferencesSelf,
987
988 Generic,
990
991 CVariadic,
993
994 UndispatchableReceiver(Option<(Span, Symbol)>),
999}
1000
1001#[derive(#[automatically_derived]impl ::core::clone::Clone for AssocConstViolation {
#[inline]
fn clone(&self) -> Self {
match self {
Self::FeatureNotEnabled => AssocConstViolation::FeatureNotEnabled,
Self::NonType => AssocConstViolation::NonType,
Self::Generic => AssocConstViolation::Generic,
Self::TypeReferencesSelf =>
AssocConstViolation::TypeReferencesSelf,
}
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for AssocConstViolation {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f,
match self {
AssocConstViolation::FeatureNotEnabled => "FeatureNotEnabled",
AssocConstViolation::NonType => "NonType",
AssocConstViolation::Generic => "Generic",
AssocConstViolation::TypeReferencesSelf =>
"TypeReferencesSelf",
})
}
}Debug, #[automatically_derived]impl ::core::marker::StructuralPartialEq for
AssocConstViolation {
}
#[automatically_derived]impl ::core::cmp::PartialEq for AssocConstViolation {
#[inline]
fn eq(&self, other: &Self) -> bool {
::core::intrinsics::discriminant_value(self) ==
::core::intrinsics::discriminant_value(other)
}
}PartialEq, #[automatically_derived]impl ::core::cmp::Eq for AssocConstViolation { }Eq, #[automatically_derived]impl ::core::hash::Hash for AssocConstViolation {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
state)
}
}Hash, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for
AssocConstViolation {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
AssocConstViolation::FeatureNotEnabled =>
0u8.stable_hash(__hcx, __hasher),
AssocConstViolation::NonType =>
1u8.stable_hash(__hcx, __hasher),
AssocConstViolation::Generic =>
2u8.stable_hash(__hcx, __hasher),
AssocConstViolation::TypeReferencesSelf =>
3u8.stable_hash(__hcx, __hasher),
}
match *self {
AssocConstViolation::FeatureNotEnabled => {}
AssocConstViolation::NonType => {}
AssocConstViolation::Generic => {}
AssocConstViolation::TypeReferencesSelf => {}
}
}
}
};StableHash)]
1003pub enum AssocConstViolation {
1004 FeatureNotEnabled,
1006
1007 NonType,
1009
1010 Generic,
1012
1013 TypeReferencesSelf,
1015}
1016
1017#[derive(#[automatically_derived]impl ::core::marker::Copy for CodegenObligationError {
}Copy, #[automatically_derived]#[doc(hidden)]unsafe impl ::core::clone::TrivialClone
for CodegenObligationError {
}
#[automatically_derived]impl ::core::clone::Clone for CodegenObligationError {
#[inline]
fn clone(&self) -> Self {
let _: ::core::clone::AssertParamIsClone<ErrorGuaranteed>;
*self
}
}Clone, #[automatically_derived]impl ::core::fmt::Debug for CodegenObligationError {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
Self::Ambiguity =>
::core::fmt::Formatter::write_str(f, "Ambiguity"),
Self::Unimplemented =>
::core::fmt::Formatter::write_str(f, "Unimplemented"),
Self::UnconstrainedParam(__self_0) =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"UnconstrainedParam", &__self_0),
}
}
}Debug, #[automatically_derived]impl ::core::hash::Hash for CodegenObligationError {
#[inline]
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
state);
match self {
Self::UnconstrainedParam(__self_0) =>
::core::hash::Hash::hash(__self_0, state),
_ => {}
}
}
}Hash, const _: () =
{
impl ::rustc_data_structures::stable_hash::StableHash for
CodegenObligationError {
#[inline]
fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
__hcx: &mut __Hcx,
__hasher:
&mut ::rustc_data_structures::stable_hash::StableHasher) {
match *self {
CodegenObligationError::Ambiguity =>
0u8.stable_hash(__hcx, __hasher),
CodegenObligationError::Unimplemented =>
1u8.stable_hash(__hcx, __hasher),
CodegenObligationError::UnconstrainedParam(ref __binding_0)
=> 2u8.stable_hash(__hcx, __hasher),
}
match *self {
CodegenObligationError::Ambiguity => {}
CodegenObligationError::Unimplemented => {}
CodegenObligationError::UnconstrainedParam(ref __binding_0)
=> {
{ __binding_0.stable_hash(__hcx, __hasher); }
}
}
}
}
};StableHash, const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for CodegenObligationError {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
CodegenObligationError::Ambiguity => { 0usize }
CodegenObligationError::Unimplemented => { 1usize }
CodegenObligationError::UnconstrainedParam(ref __binding_0)
=> {
2usize
}
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
CodegenObligationError::Ambiguity => {}
CodegenObligationError::Unimplemented => {}
CodegenObligationError::UnconstrainedParam(ref __binding_0)
=> {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
}
}
}
};Encodable, const _: () =
{
impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
for CodegenObligationError {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => { CodegenObligationError::Ambiguity }
1usize => { CodegenObligationError::Unimplemented }
2usize => {
CodegenObligationError::UnconstrainedParam(::rustc_serialize::Decodable::decode(__decoder))
}
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `CodegenObligationError`, expected 0..3, actual {0}",
n));
}
}
}
}
};Decodable)]
1019pub enum CodegenObligationError {
1020 Ambiguity,
1027 Unimplemented,
1030 UnconstrainedParam(ErrorGuaranteed),
1033}