@@ -20,7 +20,7 @@ use rustc_hir::def_id::DefId;
2020use rustc_infer:: infer:: { self , InferOk } ;
2121use rustc_middle:: traits:: ObligationCause ;
2222use rustc_middle:: ty:: subst:: { InternalSubsts , SubstsRef } ;
23- use rustc_middle:: ty:: { self , DefIdTree , GenericParamDefKind , Ty , TypeVisitable } ;
23+ use rustc_middle:: ty:: { self , GenericParamDefKind , Ty , TypeVisitable } ;
2424use rustc_span:: symbol:: Ident ;
2525use rustc_span:: Span ;
2626use rustc_trait_selection:: traits;
@@ -217,7 +217,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
217217 }
218218
219219 // We probe again, taking all traits into account (not only those in scope).
220- let mut candidates =
220+ let candidates =
221221 match self . lookup_probe ( segment. ident , self_ty, call_expr, ProbeScope :: AllTraits ) {
222222 // If we find a different result the caller probably forgot to import a trait.
223223 Ok ( ref new_pick) if pick. differs_from ( new_pick) => {
@@ -236,7 +236,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
236236 . collect ( ) ,
237237 _ => Vec :: new ( ) ,
238238 } ;
239- candidates. retain ( |candidate| * candidate != self . tcx . parent ( result. callee . def_id ) ) ;
240239
241240 return Err ( IllegalSizedBound ( candidates, needs_mut, span) ) ;
242241 }
0 commit comments