about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-06-19 21:04:06 -0700
committerMichael Goulet <michael@errs.io>2022-06-28 21:56:18 +0000
commit862873d20bb40c9f9331b36fc05c53288960d3aa (patch)
treeff9e059f5d934a8742be23557b1e875b2a814592 /compiler
parent6c0a591deef190ab9bf12836467079367a366c35 (diff)
downloadrust-862873d20bb40c9f9331b36fc05c53288960d3aa.tar.gz
rust-862873d20bb40c9f9331b36fc05c53288960d3aa.zip
Note concrete type being coerced into object
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs5
1 files changed, 3 insertions, 2 deletions
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 166c7a4110b..12858172ee5 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -2217,9 +2217,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
                     err.span_note(tcx.def_span(item_def_id), &descr);
                 }
             }
-            ObligationCauseCode::ObjectCastObligation(_, object_ty) => {
+            ObligationCauseCode::ObjectCastObligation(concrete_ty, object_ty) => {
                 err.note(&format!(
-                    "required for the cast to the object type `{}`",
+                    "required for the cast from `{}` to the object type `{}`",
+                    self.ty_to_string(concrete_ty),
                     self.ty_to_string(object_ty)
                 ));
             }