about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-01-27 16:34:28 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2022-02-02 15:40:12 +0000
commit4d2e9651060c984d18cf8863ceacf215ec00446c (patch)
tree3a6fdd4a1fcb7f1a1206afd0143da0b11613b8c2 /compiler/rustc_trait_selection
parent5518d1931d4035a207438d625464dce9c3171d54 (diff)
downloadrust-4d2e9651060c984d18cf8863ceacf215ec00446c.tar.gz
rust-4d2e9651060c984d18cf8863ceacf215ec00446c.zip
Make a span more useful
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs1
1 files changed, 1 insertions, 0 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 9eed03bb223..51b8c9aca78 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
@@ -1328,6 +1328,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
             ty::Generator(..) => "generator",
             _ => "function",
         };
+        let span = self.tcx.sess.source_map().guess_head_span(span);
         let mut err = struct_span_err!(
             self.tcx.sess,
             span,