@@ -57,7 +57,12 @@ pub enum MethodError<'tcx> {
5757 PrivateMatch ( DefKind , DefId , Vec < DefId > ) ,
5858
5959 // 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+ } ,
6166
6267 // Found a match, but the return type is wrong
6368 BadReturnType ,
@@ -112,7 +117,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
112117 Err ( NoMatch ( ..) ) => false ,
113118 Err ( Ambiguity ( ..) ) => true ,
114119 Err ( PrivateMatch ( ..) ) => allow_private,
115- Err ( IllegalSizedBound ( .. ) ) => true ,
120+ Err ( IllegalSizedBound { .. } ) => true ,
116121 Err ( BadReturnType ) => bug ! ( "no return type expectations but got BadReturnType" ) ,
117122 }
118123 }
@@ -236,7 +241,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
236241 _ => Vec :: new ( ) ,
237242 } ;
238243
239- return Err ( IllegalSizedBound ( candidates, needs_mut, span, self_expr) ) ;
244+ return Err ( IllegalSizedBound { candidates, needs_mut, bound_span : span, self_expr } ) ;
240245 }
241246
242247 Ok ( result. callee )
0 commit comments