mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
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 | ^ ```
118 lines
4.0 KiB
Plaintext
118 lines
4.0 KiB
Plaintext
error: unknown start of token: \u{0}
|
|
--> $DIR/utf16-be-without-bom.rs:4:1
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:3
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:5
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:7
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:9
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:11
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:13
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:15
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:17
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:19
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:21
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:23
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= 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/utf16-be-without-bom.rs:4:25
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^
|
|
|
|
|
= help: source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used
|
|
|
|
error: expected one of `!` or `::`, found `n`
|
|
--> $DIR/utf16-be-without-bom.rs:4:4
|
|
|
|
|
LL | ␀f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ^ expected one of `!` or `::`
|
|
|
|
|
help: consider removing the space to spell keyword `fn`
|
|
|
|
|
LL | ␀fn␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
|
|
| ~~
|
|
|
|
error: aborting due to 14 previous errors
|
|
|