rust/tests/rustdoc-ui/doctest
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
..
auxiliary Suggest standalone doctest for non-local impl defs 2024-06-15 13:00:53 +02:00
block-doc-comment.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
block-doc-comment.stdout
cfg-test.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
cfg-test.stdout
check-attr-test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
check-attr-test.stderr Follow guidelines for lint suggestions 2023-12-12 15:43:20 +01:00
check-cfg-test.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
check-cfg-test.stderr Move --check-cfg documentation to stable books 2024-04-15 21:49:56 +02:00
check-cfg-test.stdout
display-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
display-output.stdout
doc-comment-multi-line-attr.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doc-comment-multi-line-attr.stdout
doc-comment-multi-line-cfg-attr.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doc-comment-multi-line-cfg-attr.stdout
doc-test-attr-pass.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
doc-test-attr.rs Update ui tests 2024-02-29 14:43:43 +01:00
doc-test-attr.stderr Update ui tests 2024-02-29 14:43:43 +01:00
doc-test-doctest-feature.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doc-test-doctest-feature.stdout
doc-test-rustdoc-feature.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doc-test-rustdoc-feature.stdout
doctest-edition.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
doctest-edition.stderr
doctest-multiline-crate-attribute.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doctest-multiline-crate-attribute.stdout
doctest-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doctest-output.stdout
failed-doctest-compile-fail.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-compile-fail.stdout
failed-doctest-extra-semicolon-on-item.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-extra-semicolon-on-item.stdout Make parse error suggestions verbose and fix spans 2024-07-12 03:02:57 +00:00
failed-doctest-missing-codes.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-missing-codes.stdout
failed-doctest-output-windows.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-output-windows.stdout
failed-doctest-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-output.stdout
failed-doctest-should-panic.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-should-panic.stdout
no-run-flag-error.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
no-run-flag-error.stderr
no-run-flag.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
no-run-flag.stdout
nocapture-fail.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
nocapture-fail.stderr
nocapture-fail.stdout
nocapture.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
nocapture.stderr
nocapture.stdout
non_local_defs.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
non_local_defs.stderr Switch back non_local_definitions lint to allow-by-default 2024-06-27 08:05:07 +02:00
non_local_defs.stdout Switch back non_local_definitions lint to allow-by-default 2024-06-27 08:05:07 +02:00
non-local-defs-impl.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
non-local-defs-impl.stdout Suggest standalone doctest for non-local impl defs 2024-06-15 13:00:53 +02:00
private-doc-test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
private-item-doc-test.rs
private-item-doc-test.stderr
private-public-item-doc-test.rs
private-public-item-doc-test.stderr
public-reexported-item-doc-test.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
run-directory.correct.stdout
run-directory.incorrect.stdout
run-directory.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
test-compile-fail1.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
test-compile-fail1.stderr
test-compile-fail2.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
test-compile-fail2.stderr
test-compile-fail3.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
test-compile-fail3.stderr Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00
test-no_std.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
test-no_std.stdout
test-type.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
test-type.stdout
unparseable-doc-test.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
unparseable-doc-test.stdout