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 Fix invalid silencing of parsing error 2024-04-07 17:22:34 +00:00
dont-ice-on-invalid-lifetime-in-macro-definition.stderr Fix invalid silencing of parsing error 2024-04-07 17:22:34 +00:00
emoji-literal-prefix.rs Properly handle emojis as literal prefix in macros 2024-04-10 23:19:27 +00:00
emoji-literal-prefix.stderr Properly handle emojis as literal prefix in macros 2024-04-10 23:19:27 +00:00
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 Use a better link 2023-06-10 14:46:11 -04:00
lex-bad-char-literals-2.rs
lex-bad-char-literals-2.stderr review comment: str -> string in messages 2024-03-17 23:35:18 +00:00
lex-bad-char-literals-3.rs
lex-bad-char-literals-3.stderr review comment: str -> string in messages 2024-03-17 23:35:18 +00:00
lex-bad-char-literals-4.rs
lex-bad-char-literals-4.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
lex-bad-char-literals-5.rs
lex-bad-char-literals-5.stderr review comment: str -> string in messages 2024-03-17 23:35:18 +00:00
lex-bad-char-literals-6.rs
lex-bad-char-literals-6.stderr review comment: str -> string in messages 2024-03-17 23:35:18 +00:00
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 Handle str literals written with ' lexed as lifetime 2024-03-17 23:35:18 +00:00
lex-bad-str-literal-as-char-1.rs Handle str literals written with ' lexed as lifetime 2024-03-17 23:35:18 +00:00
lex-bad-str-literal-as-char-1.stderr review comment: str -> string in messages 2024-03-17 23:35:18 +00:00
lex-bad-str-literal-as-char-2.fixed Handle str literals written with ' lexed as lifetime 2024-03-17 23:35:18 +00:00
lex-bad-str-literal-as-char-2.rs Handle str literals written with ' lexed as lifetime 2024-03-17 23:35:18 +00:00
lex-bad-str-literal-as-char-2.stderr review comment: str -> string in messages 2024-03-17 23:35:18 +00:00
lex-bad-str-literal-as-char-3.rs Fix invalid silencing of parsing error 2024-04-07 17:22:34 +00:00
lex-bad-str-literal-as-char-3.rust2015.stderr Extend test to trigger on 2015, 2018 and 2021 editions 2024-03-17 23:35:19 +00:00
lex-bad-str-literal-as-char-3.rust2018.stderr Extend test to trigger on 2015, 2018 and 2021 editions 2024-03-17 23:35:19 +00:00
lex-bad-str-literal-as-char-3.rust2021.stderr Fix invalid silencing of parsing error 2024-04-07 17:22:34 +00:00
lex-bad-str-literal-as-char-4.rs Fix invalid silencing of parsing error 2024-04-07 17:22:34 +00:00
lex-bad-str-literal-as-char-4.stderr Fix invalid silencing of parsing error 2024-04-07 17:22:34 +00:00
lex-bad-token.rs
lex-bad-token.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
lex-bare-cr-nondoc-comment.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
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 separate messages for individual categories 2024-02-26 10:09:03 +08:00
lex-emoji-identifiers.stderr separate messages for individual categories 2024-02-26 10:09:03 +08:00
lex-stray-backslash.rs
lex-stray-backslash.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
lexer-crlf-line-endings-string-literal-doc-comment.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unterminated-comment.rs Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
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 Move some UI tests into subdirectories 2023-04-02 19:42:30 -04:00
unterminated-nested-comment.stderr Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00