Fix the bug of next_point in span
This commit is contained in:
parent
11432fe952
commit
0af255a5aa
7 changed files with 13 additions and 13 deletions
|
@ -937,13 +937,12 @@ pub fn ensure_complete_parse<'a>(
|
|||
kind_name,
|
||||
);
|
||||
err.note(&msg);
|
||||
let semi_span = this.sess.source_map().next_point(span);
|
||||
|
||||
let semi_full_span = semi_span.to(this.sess.source_map().next_point(semi_span));
|
||||
match this.sess.source_map().span_to_snippet(semi_full_span) {
|
||||
let semi_span = this.sess.source_map().next_point(span);
|
||||
match this.sess.source_map().span_to_snippet(semi_span) {
|
||||
Ok(ref snippet) if &snippet[..] != ";" && kind_name == "expression" => {
|
||||
err.span_suggestion(
|
||||
semi_span,
|
||||
span.shrink_to_hi(),
|
||||
"you might be missing a semicolon here",
|
||||
";",
|
||||
Applicability::MaybeIncorrect,
|
||||
|
|
|
@ -82,7 +82,7 @@ fn emit_frag_parse_err(
|
|||
);
|
||||
if !e.span.is_dummy() {
|
||||
// early end of macro arm (#52866)
|
||||
e.replace_span_with(parser.sess.source_map().next_point(parser.token.span));
|
||||
e.replace_span_with(parser.token.span.shrink_to_hi());
|
||||
}
|
||||
}
|
||||
if e.span.is_dummy() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue