about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-04-27 20:46:07 +0200
committerGitHub <noreply@github.com>2024-04-27 20:46:07 +0200
commit52ce43e9ac31efda1450a10470a4245284cba83e (patch)
tree3182c5994b74039a868769b8ccb0a0f769a107d5 /tests/codegen/patchable-function-entry
parent61a1dbd751ab7f3c973be17d7ff3948ffda07c6e (diff)
parentb52e4bd99709fdf3c9b709f285d0ab4278fbcf8f (diff)
downloadrust-52ce43e9ac31efda1450a10470a4245284cba83e.tar.gz
rust-52ce43e9ac31efda1450a10470a4245284cba83e.zip
Rollup merge of #124370 - ShE3py:substitution-part-offset, r=fee1-dead
Fix substitution parts having a shifted underline in some cases

If two suggestions parts are side by side, the underline's offset:
(WIP PR as an example, not yet pushed)
```
error: expected a pattern, found an expression
 --> ./main.rs:4:9
  |
4 |         1 + 2 => 3
  |         ^^^^^ arbitrary expressions are not allowed in patterns
  |
help: check the value in an arm guard
  |
4 |         n if n == 1 + 2 => 3
  |         ~     +++++++++++++
```
The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.)

```
help: check the value in an arm guard
  |
4 |         n if n == 1 + 2 => 3
  |         ~ +++++++++++++
```

``@rustbot`` label +A-suggestion-diagnostics
Diffstat (limited to 'tests/codegen/patchable-function-entry')
0 files changed, 0 insertions, 0 deletions