2d7795dfb9
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 | ^ ```
48 lines
1.3 KiB
Plaintext
48 lines
1.3 KiB
Plaintext
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
|
||
|