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 | ^ ```
42 lines
990 B
Plaintext
42 lines
990 B
Plaintext
error: unknown start of token: \u{1c}
|
|
--> $DIR/issue-68629.rs:4:1
|
|
|
|
|
LL | ␜␟ts␀![{i
|
|
| ^
|
|
|
|
error: unknown start of token: \u{1f}
|
|
--> $DIR/issue-68629.rs:4:2
|
|
|
|
|
LL | ␜␟ts␀![{i
|
|
| ^
|
|
|
|
error: unknown start of token: \u{0}
|
|
--> $DIR/issue-68629.rs:4:5
|
|
|
|
|
LL | ␜␟ts␀![{i
|
|
| ^
|
|
|
|
|
= 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-68629.rs:5:1
|
|
|
|
|
LL | ␀␀ fn rݻoa>rݻm
|
|
| ^^
|
|
|
|
|
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
|
|
= note: character appears once more
|
|
|
|
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
|
|
| ^
|
|
|
|
error: aborting due to 5 previous errors
|
|
|