diff --git a/src/librustc_parse/parser/mod.rs b/src/librustc_parse/parser/mod.rs index 1e28372c384..8c1839da1cb 100644 --- a/src/librustc_parse/parser/mod.rs +++ b/src/librustc_parse/parser/mod.rs @@ -671,12 +671,12 @@ impl<'a> Parser<'a> { true } token::BinOp(token::Shl) => { - let span = self.token.span.with_lo(self.token.span.lo() + BytePos(1)); + let span = self.sess.source_map().next_point(self.token.span); self.bump_with(token::Lt, span); true } token::LArrow => { - let span = self.token.span.with_lo(self.token.span.lo() + BytePos(1)); + let span = self.sess.source_map().next_point(self.token.span); self.bump_with(token::BinOp(token::Minus), span); true } diff --git a/src/test/ui/parser/issue-68730.rs b/src/test/ui/parser/issue-68730.rs new file mode 100644 index 00000000000..b570e941775 Binary files /dev/null and b/src/test/ui/parser/issue-68730.rs differ diff --git a/src/test/ui/parser/issue-68730.stderr b/src/test/ui/parser/issue-68730.stderr new file mode 100644 index 00000000000..5f9ed56e2d7 Binary files /dev/null and b/src/test/ui/parser/issue-68730.stderr differ