diff options
| author | Michael Goulet <michael@errs.io> | 2022-06-19 21:04:06 -0700 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-06-28 21:56:18 +0000 |
| commit | 862873d20bb40c9f9331b36fc05c53288960d3aa (patch) | |
| tree | ff9e059f5d934a8742be23557b1e875b2a814592 /compiler | |
| parent | 6c0a591deef190ab9bf12836467079367a366c35 (diff) | |
| download | rust-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.rs | 5 |
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) )); } |
