diff options
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/infer.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs index 4b11cc3ace9..251f0628a71 100644 --- a/compiler/rustc_trait_selection/src/infer.rs +++ b/compiler/rustc_trait_selection/src/infer.rs @@ -101,11 +101,10 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> { self.tcx.impl_trait_ref(impl_def_id).map(|r| (impl_def_id, r)) }) .map(|(impl_def_id, imp)| (impl_def_id, imp.skip_binder())) - .filter(|(_, imp)| match imp.self_ty().peel_refs().kind() { + .find(|(_, imp)| match imp.self_ty().peel_refs().kind() { ty::Adt(i_def, _) if i_def.did() == def.did() => true, _ => false, }) - .next() { let mut fulfill_cx = FulfillmentCtxt::new(self); // We get all obligations from the impl to talk about specific diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs index f7e8dc62a62..1033fe68140 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs @@ -2167,7 +2167,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> { }) .collect(); err.multipart_suggestion( - format!("consider wrapping the function in a closure"), + "consider wrapping the function in a closure", vec