]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_infer/traits/coherence.rs
Update const_forget.rs
[rust.git] / src / librustc_infer / traits / coherence.rs
index 43c0fbc27e620f597757360c930b5ebb44dc9000..0dec5ae6da57a3054ae82fa80c5bc63bcab2efda 100644 (file)
@@ -39,10 +39,10 @@ pub struct OverlapResult<'tcx> {
 }
 
 pub fn add_placeholder_note(err: &mut rustc_errors::DiagnosticBuilder<'_>) {
-    err.note(&format!(
+    err.note(
         "this behavior recently changed as a result of a bug fix; \
-         see rust-lang/rust#56105 for details"
-    ));
+         see rust-lang/rust#56105 for details",
+    );
 }
 
 /// If there are types that satisfy both impls, invokes `on_overlap`
@@ -399,8 +399,7 @@ fn uncover_fundamental_ty<'tcx>(
             let local_type = trait_ref
                 .input_types()
                 .flat_map(|ty| uncover_fundamental_ty(tcx, ty, in_crate))
-                .filter(|ty| ty_is_non_local_constructor(ty, in_crate).is_none())
-                .next();
+                .find(|ty| ty_is_non_local_constructor(ty, in_crate).is_none());
 
             debug!("orphan_check_trait_ref: uncovered ty local_type: `{:?}`", local_type);