@@ -57,7 +57,12 @@ pub enum MethodError<'tcx> {
57
57
PrivateMatch ( DefKind , DefId , Vec < DefId > ) ,
58
58
59
59
// Found a `Self: Sized` bound where `Self` is a trait object.
60
- IllegalSizedBound ( Vec < DefId > , bool , Span , & ' tcx hir:: Expr < ' tcx > ) ,
60
+ IllegalSizedBound {
61
+ candidates : Vec < DefId > ,
62
+ needs_mut : bool ,
63
+ bound_span : Span ,
64
+ self_expr : & ' tcx hir:: Expr < ' tcx > ,
65
+ } ,
61
66
62
67
// Found a match, but the return type is wrong
63
68
BadReturnType ,
@@ -112,7 +117,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
112
117
Err ( NoMatch ( ..) ) => false ,
113
118
Err ( Ambiguity ( ..) ) => true ,
114
119
Err ( PrivateMatch ( ..) ) => allow_private,
115
- Err ( IllegalSizedBound ( .. ) ) => true ,
120
+ Err ( IllegalSizedBound { .. } ) => true ,
116
121
Err ( BadReturnType ) => bug ! ( "no return type expectations but got BadReturnType" ) ,
117
122
}
118
123
}
@@ -236,7 +241,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
236
241
_ => Vec :: new ( ) ,
237
242
} ;
238
243
239
- return Err ( IllegalSizedBound ( candidates, needs_mut, span, self_expr) ) ;
244
+ return Err ( IllegalSizedBound { candidates, needs_mut, bound_span : span, self_expr } ) ;
240
245
}
241
246
242
247
Ok ( result. callee )
0 commit comments