]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Rollup merge of #107116 - ozkanonur:consolidate-bootstrap-docs, r=jyn514
[rust.git] / compiler / rustc_trait_selection / src / traits / error_reporting / suggestions.rs
index ee0c07e15a3add65ba31bac75870c6ec01f2f3ec..87dbf7c3fd699b2649d36acb122d49de5a99676c 100644 (file)
@@ -133,7 +133,7 @@ fn get_from_await_ty<F>(
                                         .cloned()
                                         .unwrap_or_else(|| {
                                             bug!(
-                                                "node_type: no type for node `{}`",
+                                                "node_type: no type for node {}",
                                                 ty::tls::with(|tcx| tcx
                                                     .hir()
                                                     .node_to_string(await_expr.hir_id))
@@ -1748,7 +1748,7 @@ fn suggest_impl_trait(
                 // If the `dyn Trait` is not object safe, do not suggest `Box<dyn Trait>`.
                 predicates
                     .principal_def_id()
-                    .map_or(true, |def_id| self.tcx.object_safety_violations(def_id).is_empty())
+                    .map_or(true, |def_id| self.tcx.check_is_object_safe(def_id))
             }
             // We only want to suggest `impl Trait` to `dyn Trait`s.
             // For example, `fn foo() -> str` needs to be filtered out.