]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/check/method/suggest.rs
Rollup merge of #85766 - workingjubilee:file-options, r=yaahc
[rust.git] / compiler / rustc_typeck / src / check / method / suggest.rs
index 8007b9f23776a169f141afa3d63ca7f61617839a..71cd8a43329c5df8a8f25bdab7c2d310fb3a1158 100644 (file)
@@ -1208,7 +1208,7 @@ fn suggest_valid_traits(
             let edition_fix = candidates
                 .iter()
                 .find(|did| self.tcx.is_diagnostic_item(sym::TryInto, **did))
-                .map(|&d| d);
+                .copied();
 
             err.help("items from traits can only be used if the trait is in scope");
             let msg = format!(
@@ -1410,7 +1410,7 @@ fn suggest_traits_to_import(
                                 }
                             }
                             // We only want to suggest public or local traits (#45781).
-                            item.vis == ty::Visibility::Public || info.def_id.is_local()
+                            item.vis.is_public() || info.def_id.is_local()
                         })
                         .is_some()
             })