From 4d2e9651060c984d18cf8863ceacf215ec00446c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 27 Jan 2022 16:34:28 +0000 Subject: Make a span more useful --- compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'compiler/rustc_trait_selection/src') 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, -- cgit 1.4.1-3-g733a5