rust/tests/ui/parser/issues/issue-68730.stderr
Esteban Küber 2d7795dfb9 Be more accurate about calculating display_col from a BytePos
No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter.

This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2):

```
error: this file contains an unclosed delimiter
  --> $DIR/issue-68629.rs:5:17
   |
LL | ␜␟ts␀![{i
   |       -- unclosed delimiter
   |       |
   |       unclosed delimiter
LL | ␀␀  fn rݻoa>rݻm
   |                ^
```
2024-07-18 20:08:38 +00:00

48 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

error: unknown start of token: \u{0}
--> $DIR/issue-68730.rs:5:5
|
LL | enum␀em␀˂˂
| ^
|
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{0}
--> $DIR/issue-68730.rs:5:8
|
LL | enum␀em␀˂˂
| ^
|
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
error: unknown start of token: \u{2c2}
--> $DIR/issue-68730.rs:5:9
|
LL | enum␀em␀˂˂
| ^^
|
= note: character appears once more
help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not
|
LL | enum␀em␀<<
| ~~
error: unknown start of token: \u{2c2}
--> $DIR/issue-68730.rs:5:10
|
LL | enum␀em␀˂˂
| ^
|
help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not
|
LL | enum␀em␀˂<
| ~
error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `<`
--> $DIR/issue-68730.rs:5:10
|
LL | enum␀em␀˂˂
| ^ expected one of `#`, `>`, `const`, identifier, or lifetime
error: aborting due to 5 previous errors