rust/tests/ui/lexer
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
..
dont-ice-on-invalid-lifetime-in-macro-definition.rs
dont-ice-on-invalid-lifetime-in-macro-definition.stderr
emoji-literal-prefix.rs
emoji-literal-prefix.stderr
error-stage.rs
error-stage.stderr
lex-bad-binary-literal.rs
lex-bad-binary-literal.stderr
lex-bad-char-literals-1.rs
lex-bad-char-literals-1.stderr
lex-bad-char-literals-2.rs
lex-bad-char-literals-2.stderr
lex-bad-char-literals-3.rs
lex-bad-char-literals-3.stderr
lex-bad-char-literals-4.rs
lex-bad-char-literals-4.stderr
lex-bad-char-literals-5.rs
lex-bad-char-literals-5.stderr
lex-bad-char-literals-6.rs
lex-bad-char-literals-6.stderr
lex-bad-char-literals-7.rs
lex-bad-char-literals-7.stderr
lex-bad-numeric-literals.rs
lex-bad-numeric-literals.stderr
lex-bad-octal-literal.rs
lex-bad-octal-literal.stderr
lex-bad-str-literal-as-char-1.fixed
lex-bad-str-literal-as-char-1.rs
lex-bad-str-literal-as-char-1.stderr
lex-bad-str-literal-as-char-2.fixed
lex-bad-str-literal-as-char-2.rs
lex-bad-str-literal-as-char-2.stderr
lex-bad-str-literal-as-char-3.rs
lex-bad-str-literal-as-char-3.rust2015.stderr
lex-bad-str-literal-as-char-3.rust2018.stderr
lex-bad-str-literal-as-char-3.rust2021.stderr
lex-bad-str-literal-as-char-4.rs
lex-bad-str-literal-as-char-4.stderr
lex-bad-token.rs
lex-bad-token.stderr
lex-bare-cr-nondoc-comment.rs
lex-bare-cr-string-literal-doc-comment.rs
lex-bare-cr-string-literal-doc-comment.stderr Replace ASCII control chars with Unicode Control Pictures 2024-07-18 19:23:42 +00:00
lex-emoji-identifiers.rs
lex-emoji-identifiers.stderr
lex-stray-backslash.rs
lex-stray-backslash.stderr
lexer-crlf-line-endings-string-literal-doc-comment.rs
unterminated-comment.rs
unterminated-comment.stderr Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00
unterminated-nested-comment.rs
unterminated-nested-comment.stderr Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00