1
Fork 0

fix the span in the suggestion of remove question mark

This commit is contained in:
bohan 2023-08-03 16:44:02 +08:00
parent 2e6ac7fe5b
commit 2195fa6a9b
3 changed files with 32 additions and 1 deletions

View file

@ -764,7 +764,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
Some(ty) if expected == ty => {
let source_map = self.tcx.sess.source_map();
err.span_suggestion(
source_map.end_point(cause.span),
source_map.end_point(cause.span()),
"try removing this `?`",
"",
Applicability::MachineApplicable,