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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
cfg-test.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
cfg-test.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
display-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
display-output.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doctest-edition.rs [AUTO_GENERATED] Migrate compiletest to use ui_test-style //@ directives 2024-02-22 16:04:04 +00:00
doctest-edition.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
doctest-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
doctest-output.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
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 Manual find replace updates 2023-11-24 21:04:51 +01:00
failed-doctest-output.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
failed-doctest-output.stdout Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
no-run-flag.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
no-run-flag.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
nocapture-fail.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
nocapture-fail.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
nocapture-fail.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
nocapture.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
nocapture.stderr Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
nocapture.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
private-item-doc-test.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
private-public-item-doc-test.rs Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
private-public-item-doc-test.stderr Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
run-directory.incorrect.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
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 Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
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 Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00
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 Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
test-type.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
test-type.stdout Move some rustdoc-ui tests to subdirectories 2023-04-29 11:36:19 -05:00
unparseable-doc-test.rs Always use a colon in //@ normalize-*: headers 2024-07-11 12:23:44 +10:00
unparseable-doc-test.stdout Bless rustdoc-ui tests 2023-11-24 19:15:52 +01:00