about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-08-09 18:24:59 +0200
committerGitHub <noreply@github.com>2024-08-09 18:24:59 +0200
commit9eb77ac3e06d54aa94789982d8df499f649d6bc1 (patch)
treebc9ca014720e0a82dfa739b76cd751b2ab3b011b /compiler/rustc_codegen_llvm/src
parent2e0c5adf04fd2d0a093d05c961c9bf7c99a0aecf (diff)
parent879bfd7ad0f5f79e7bc90320dfb80dfabe91ac2b (diff)
downloadrust-9eb77ac3e06d54aa94789982d8df499f649d6bc1.tar.gz
rust-9eb77ac3e06d54aa94789982d8df499f649d6bc1.zip
Rollup merge of #128864 - jieyouxu:funnicode, r=Urgau
Use `SourceMap::end_point` instead of `- BytePos(1)` in arg removal suggestion

Previously, we tried to remove extra arg commas when providing extra arg removal suggestions. One of
the edge cases is having to account for an arg that has a closing delimiter `)` following it.
However, the previous suggestion code assumed that the delimiter is in fact exactly the 1-byte `)`
character. This assumption was proven incorrect, because we recover from Unicode-confusable
delimiters in the parser, which means that the ending delimiter could be a multi-byte codepoint
that looks *like* a `)`. Subtracing 1 byte could land us in the middle of a codepoint, triggering a
codepoint boundary assertion.

This is fixed by using `SourceMap::end_point` which properly accounts for codepoint boundaries.

Fixes #128717.

cc ````@fmease```` and #128790
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions