rust/compiler/rustc_parse
许杰友 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
..
src parser: ensure let stmt compound assignment removal suggestion respect codepoint boundaries 2024-08-09 05:56:50 +00:00
Cargo.toml Move some tests from rustc_expand to rustc_parse. 2024-05-06 09:06:02 +10:00
messages.ftl Rollup merge of #128496 - clubby789:box-syntax-multipart, r=compiler-errors 2024-08-01 18:43:41 +02:00