Fix incorrect semicolon suggestion
This commit is contained in:
parent
ad144ac3c1
commit
f8818cbf8f
@ -1044,7 +1044,9 @@ pub fn ensure_complete_parse(&mut self, macro_path: &Path, kind_name: &str, span
|
||||
);
|
||||
err.note(&msg);
|
||||
let semi_span = self.sess.source_map().next_point(span);
|
||||
match self.sess.source_map().span_to_snippet(semi_span) {
|
||||
|
||||
let semi_full_span = semi_span.to(self.sess.source_map().next_point(semi_span));
|
||||
match self.sess.source_map().span_to_snippet(semi_full_span) {
|
||||
Ok(ref snippet) if &snippet[..] != ";" && kind_name == "expression" => {
|
||||
err.span_suggestion_with_applicability(
|
||||
semi_span,
|
||||
|
@ -16,9 +16,7 @@ LL | () => ( i ; typeof ); //~ ERROR expected expression, found reserved k
|
||||
| ^^^^^^
|
||||
...
|
||||
LL | let i = m!();
|
||||
| ----- help: you might be missing a semicolon here: `;`
|
||||
| |
|
||||
| caused by the macro expansion here
|
||||
| ---- caused by the macro expansion here
|
||||
|
|
||||
= note: the usage of `m!` is likely invalid in expression context
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user