From 782cba8fe3d83427036734327e5a4b4aa6641277 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 13 May 2024 04:30:14 +0000 Subject: [PATCH] Add `help` about using `cargo tree` --- .../error_reporting/type_err_ctxt_ext.rs | 6 ++--- .../crate-loading/multiple-dep-versions.svg | 24 ++++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs index fa8ee91c9cd0a..1c8eecadfbe67 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs @@ -2041,10 +2041,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { let mut span: MultiSpan = vec![sp_candidate, sp_found].into(); span.push_span_label(self.tcx.def_span(trait_def_id), "this is the required trait"); span.push_span_label(sp_candidate, "this type implements the required trait"); - span.push_span_label( - sp_found, - "this type doesn't implement the required trait", - ); + span.push_span_label(sp_found, "this type doesn't implement the required trait"); err.highlighted_span_note( span, vec![ @@ -2057,6 +2054,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> { ], ); } + err.help("you can use `cargo tree` to explore your dependency tree"); return true; } diff --git a/tests/ui/crate-loading/multiple-dep-versions.svg b/tests/ui/crate-loading/multiple-dep-versions.svg index 6b89ca691e0bc..671f38d3eb013 100644 --- a/tests/ui/crate-loading/multiple-dep-versions.svg +++ b/tests/ui/crate-loading/multiple-dep-versions.svg @@ -1,4 +1,4 @@ - +