提交 f8818cbf 编写于 作者: E Esteban Küber

Fix incorrect semicolon suggestion

上级 ad144ac3
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册