about summary refs log tree commit diff
path: root/tests/ui/parser/utf16-le-without-bom.stderr
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2024-07-09 17:00:19 +0000
committerEsteban Küber <esteban@kuber.com.ar>2024-07-18 20:08:38 +0000
commit2d7795dfb942d49d447837ef43db89216de15696 (patch)
treef1ef42e40392a1a0e1b7114662492507309e526e /tests/ui/parser/utf16-le-without-bom.stderr
parent89f273f40dafb693139496ed6f914872b6533fa6 (diff)
downloadrust-2d7795dfb942d49d447837ef43db89216de15696.tar.gz
rust-2d7795dfb942d49d447837ef43db89216de15696.zip
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
   |                ^
```
Diffstat (limited to 'tests/ui/parser/utf16-le-without-bom.stderr')
-rw-r--r--tests/ui/parser/utf16-le-without-bom.stderr24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/ui/parser/utf16-le-without-bom.stderr b/tests/ui/parser/utf16-le-without-bom.stderr
index 53004ac942d..ad272a70f06 100644
--- a/tests/ui/parser/utf16-le-without-bom.stderr
+++ b/tests/ui/parser/utf16-le-without-bom.stderr
@@ -10,7 +10,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:4
    |
 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
 
@@ -18,7 +18,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:6
    |
 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
 
@@ -26,7 +26,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:8
    |
 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
 
@@ -34,7 +34,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:10
    |
 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
 
@@ -42,7 +42,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:12
    |
 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
 
@@ -50,7 +50,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:14
    |
 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
 
@@ -58,7 +58,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:16
    |
 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
 
@@ -66,7 +66,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:18
    |
 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
 
@@ -74,7 +74,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:20
    |
 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
 
@@ -82,7 +82,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:22
    |
 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
 
@@ -90,7 +90,7 @@ error: unknown start of token: \u{0}
   --> $DIR/utf16-le-without-bom.rs:4:24
    |
 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
 
@@ -106,7 +106,7 @@ error: expected one of `!` or `::`, found `n`
   --> $DIR/utf16-le-without-bom.rs:4:3
    |
 LL | f␀n␀ ␀m␀a␀i␀n␀(␀)␀ ␀{␀}␀
-   |  ^ expected one of `!` or `::`
+   |   ^ expected one of `!` or `::`
    |
 help: consider removing the space to spell keyword `fn`
    |