Make a span more useful

This commit is contained in:
Oli Scherer 2022-01-27 16:34:28 +00:00
parent 5518d1931d
commit 4d2e965106
2 changed files with 6 additions and 12 deletions

View file

@ -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,