1
Fork 0
rust/compiler/rustc_parse/src
许杰友 Jieyou Xu (Joe) d65f1316bb parser: ensure let stmt compound assignment removal suggestion respect codepoint boundaries
Previously we would try to issue a suggestion for `let x <op>= 1`, i.e.
a compound assignment within a `let` binding, to remove the `<op>`. The
suggestion code unfortunately incorrectly assumed that the `<op>` is an
exactly-1-byte ASCII character, but this assumption is incorrect because
we also recover Unicode-confusables like `=` as `-=`. In this example,
the suggestion code used a `+ BytePos(1)` to calculate the span of the
`<op>` codepoint that looks like `-` but the mult-byte Unicode
look-alike would cause the suggested removal span to be inside a
multi-byte codepoint boundary, triggering a codepoint boundary
assertion.

Issue: <https://github.com/rust-lang/rust/issues/128845>
2024-08-09 05:56:50 +00:00
..
lexer Auto merge of #127955 - chenyukang:yukang-fix-mismatched-delimiter-issue-12786, r=nnethercote 2024-07-30 13:02:16 +00:00
parser parser: ensure let stmt compound assignment removal suggestion respect codepoint boundaries 2024-08-09 05:56:50 +00:00
errors.rs Rollup merge of #128496 - clubby789:box-syntax-multipart, r=compiler-errors 2024-08-01 18:43:41 +02:00
lib.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
validate_attr.rs Add toggle for parse_meta_item unsafe parsing 2024-07-30 18:28:43 -05:00