1
Fork 0

Improve diagnostic for missing space in range pattern

This commit is contained in:
clubby789 2023-01-30 23:47:10 +00:00
parent a9985cf172
commit 4ab75de934
6 changed files with 24 additions and 21 deletions

View file

@ -744,7 +744,7 @@ impl<'a> Parser<'a> {
}
token::Gt if no_space => {
let after_pat = span.with_hi(span.hi() - rustc_span::BytePos(1)).shrink_to_hi();
self.sess.emit_err(InclusiveRangeMatchArrow { span, after_pat });
self.sess.emit_err(InclusiveRangeMatchArrow { span, arrow: tok.span, after_pat });
}
_ => {
self.sess.emit_err(InclusiveRangeNoEnd { span });