Trim whitespace in RemoveLet primary span
Separate `RemoveLet` span into primary span for `let` and removal suggestion span for `let `, so that primary span does not include whitespace. Fixes: #133031 Signed-off-by: Tyrone Wu <wudevelops@gmail.com>
This commit is contained in:
parent
c82e0dff84
commit
dd557c988f
5 changed files with 31 additions and 15 deletions
|
@ -685,7 +685,7 @@ impl<'a> Parser<'a> {
|
|||
self.bump();
|
||||
// Trim extra space after the `let`
|
||||
let span = lo.with_hi(self.token.span.lo());
|
||||
self.dcx().emit_err(RemoveLet { span });
|
||||
self.dcx().emit_err(RemoveLet { span: lo, suggestion: span });
|
||||
lo = self.token.span;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue