about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2022-03-27 02:08:58 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2022-04-04 21:06:35 +0000
commita6301cab5e3512bf28c69e60e28e8253911702c9 (patch)
tree2889ea8ca28aa8362349839d30dbd099dc0d9e7a
parent3109c931b495f72fb9758bef15d38aeedc354ca1 (diff)
downloadrust-a6301cab5e3512bf28c69e60e28e8253911702c9.tar.gz
rust-a6301cab5e3512bf28c69e60e28e8253911702c9.zip
Highlight `is` in the message for emphasis
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
index 88a4b6ee06d..de35f545f06 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
@@ -1766,12 +1766,11 @@ impl<'a, 'tcx> InferCtxtPrivExt<'a, 'tcx> for InferCtxt<'a, 'tcx> {
             if candidates.len() == 1 {
                 err.highlighted_help(vec![
                     (
-                        format!(
-                            "the trait `{}` is implemented for `",
-                            candidates[0].print_only_trait_path()
-                        ),
+                        format!("the trait `{}` ", candidates[0].print_only_trait_path()),
                         Style::NoStyle,
                     ),
+                    ("is".to_string(), Style::Highlight),
+                    (" implemented for `".to_string(), Style::NoStyle),
                     (candidates[0].self_ty().to_string(), Style::Highlight),
                     ("`".to_string(), Style::NoStyle),
                 ]);