rust/tests/ui/span
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 Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-borrow-overloaded-auto-deref-mut.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-borrow-overloaded-auto-deref-mut.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-borrow-overloaded-deref-mut.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-borrow-overloaded-deref-mut.stderr tweak "make mut" spans (No. 2) 2023-05-05 22:40:05 +12:00
borrowck-call-is-borrow-issue-12224.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-call-is-borrow-issue-12224.stderr Suggest .clone() in some move errors 2024-04-11 16:41:41 +00:00
borrowck-call-method-from-mut-aliasable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-call-method-from-mut-aliasable.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
borrowck-fn-in-const-b.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-fn-in-const-b.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
borrowck-let-suggestion-suffixes.rs Account for method call and indexing when looking for inner-most path in expression 2023-01-17 02:52:43 +00:00
borrowck-let-suggestion-suffixes.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-object-mutability.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
borrowck-object-mutability.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
borrowck-ref-into-rvalue.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-ref-into-rvalue.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
borrowck-ref-into-rvalue.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
coerce-suggestions.rs remove sub_relations from infcx, recompute in diagnostics 2024-02-22 17:29:25 +01:00
coerce-suggestions.stderr remove sub_relations from infcx, recompute in diagnostics 2024-02-22 17:29:25 +01:00
destructor-restrictions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
destructor-restrictions.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr Be more accurate about calculating display_col from a BytePos 2024-07-18 20:08:38 +00:00
drop-location-span-error-rust-2021-incompatible-closure-captures-96258.rs Make sure that async closures (and fns) only capture their parent callable's parameters by move, and nothing else 2024-02-06 02:22:57 +00:00
drop-location-span-error-rust-2021-incompatible-closure-captures-96258.stderr Make sure that async closures (and fns) only capture their parent callable's parameters by move, and nothing else 2024-02-06 02:22:57 +00:00
dropck_arr_cycle_checked.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_arr_cycle_checked.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck_direct_cycle_with_drop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_direct_cycle_with_drop.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck_misc_variants.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_misc_variants.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck_vec_cycle_checked.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck_vec_cycle_checked.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
dropck-object-cycle.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
dropck-object-cycle.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
E0046.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0046.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
E0072.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0072.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
E0204.rs may not => cannot 2023-03-08 00:00:18 +00:00
E0204.stderr may not => cannot 2023-03-08 00:00:18 +00:00
E0493.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0493.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
E0535.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0535.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
E0536.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0536.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
E0537.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
E0537.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
gated-features-attr-spans.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
gated-features-attr-spans.stderr Bless tests 2024-01-13 12:46:58 -05:00
impl-wrong-item-for-trait.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
impl-wrong-item-for-trait.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
import-ty-params.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
import-ty-params.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-ex1.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-ex1.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue28498-reject-lifetime-param.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-lifetime-param.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue28498-reject-passed-to-fn.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-passed-to-fn.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue28498-reject-trait-bound.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue28498-reject-trait-bound.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-11925.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-11925.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-15480.fixed [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-15480.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-15480.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-23338-locals-die-before-temps-of-body.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23338-locals-die-before-temps-of-body.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
issue-23729.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-23729.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-23827.rs Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
issue-23827.stderr Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
issue-24356.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24356.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-24690.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-24690.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24805-dropck-child-has-items-via-parent.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24805-dropck-child-has-items-via-parent.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-24805-dropck-trait-has-items.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24805-dropck-trait-has-items.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-24895-copy-clone-dropck.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-24895-copy-clone-dropck.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-25199.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-25199.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-26656.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-26656.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-27522.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-27522.stderr Replace item names containing an error code with something more meaningful 2024-04-30 22:27:19 +02:00
issue-29106.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-29106.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
issue-29595.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-29595.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-33884.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-33884.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-34264.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-34264.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
issue-35987.rs Merge collect_mod_item_types query into check_well_formed 2024-03-07 14:26:31 +00:00
issue-35987.stderr Merge collect_mod_item_types query into check_well_formed 2024-03-07 14:26:31 +00:00
issue-36537.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-36537.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-37767.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-37767.stderr Rework print_disambiguation_help 2023-11-07 05:23:09 +00:00
issue-39018.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-39018.stderr Tweak borrow suggestion 2023-05-08 03:36:30 +00:00
issue-39698.rs Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
issue-39698.stderr Continue to borrowck even if there were previous errors 2024-02-08 08:10:43 +00:00
issue-40157.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-40157.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
issue-42234-unknown-receiver-type.full.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-42234-unknown-receiver-type.generic_arg.stderr diagnostics: update test cases to refer to assoc fn with self as method 2023-02-22 08:40:47 -07:00
issue-42234-unknown-receiver-type.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-43927-non-ADT-derive.rs Supress unhelpful diagnostics for unresolved top level attributes 2024-01-29 17:43:07 +08:00
issue-43927-non-ADT-derive.stderr Supress unhelpful diagnostics for unresolved top level attributes 2024-01-29 17:43:07 +08:00
issue-71363.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-71363.stderr Tweak output for 'add line' suggestion 2023-04-12 22:50:10 +00:00
issue-81800.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-81800.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
issue-107353.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-unused-unsafe.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
lint-unused-unsafe.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
macro-span-replacement.rs macro_rules: Preserve all metavariable spans in a global side table 2024-02-18 11:19:24 +03:00
macro-span-replacement.stderr macro_rules: Preserve all metavariable spans in a global side table 2024-02-18 11:19:24 +03:00
macro-ty-params.rs ignore generics args in attribute paths 2024-05-11 00:13:27 +08:00
macro-ty-params.stderr ignore generics args in attribute paths 2024-05-11 00:13:27 +08:00
method-and-field-eager-resolution.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
method-and-field-eager-resolution.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
missing-unit-argument.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
missing-unit-argument.stderr Use ordinal number in argument error 2024-07-14 13:50:09 +09:00
move-closure.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
move-closure.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
multiline-span-E0072.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiline-span-E0072.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
multiline-span-simple.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
multiline-span-simple.stderr Spell out other trait diagnostic 2024-06-12 12:34:47 +00:00
multispan-import-lint.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
multispan-import-lint.stderr Make early lints translatable 2024-05-21 20:16:39 +00:00
mut-arg-hint.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mut-arg-hint.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
mut-ptr-cant-outlive-ref.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
mut-ptr-cant-outlive-ref.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
non-existing-module-import.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
non-existing-module-import.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
pub-struct-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
pub-struct-field.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
range-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
range-2.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
recursive-type-field.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
recursive-type-field.stderr Fix ... in multline code-skips in suggestions 2024-06-20 04:25:17 +00:00
regionck-unboxed-closure-lifetimes.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regionck-unboxed-closure-lifetimes.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
regions-close-over-borrowed-ref-in-obj.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-close-over-borrowed-ref-in-obj.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
regions-close-over-type-parameter-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-close-over-type-parameter-2.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
regions-escape-loop-via-variable.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-escape-loop-via-variable.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
regions-escape-loop-via-vec.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-escape-loop-via-vec.stderr Do not set up wrong span for adjustments 2023-07-10 20:09:26 +00:00
regions-infer-borrow-scope-within-loop.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
regions-infer-borrow-scope-within-loop.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
send-is-not-static-ensures-scoping.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
send-is-not-static-ensures-scoping.stderr Modify find_expr from Span to better account for closures 2024-04-24 22:21:13 +00:00
send-is-not-static-std-sync-2.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
send-is-not-static-std-sync-2.stderr Evaluate place expression in PlaceMention. 2023-04-21 21:34:59 +00:00
send-is-not-static-std-sync.rs Remove Drop impl of mpsc Receiver and (Sync)Sender 2023-08-18 14:46:20 +02:00
send-is-not-static-std-sync.stderr Account for unops when suggesting cloning 2024-04-11 16:41:41 +00:00
slice-borrow.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
slice-borrow.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
suggestion-non-ascii.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
suggestion-non-ascii.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
suggestion-raw-68962.rs Add raw identifier in a typo suggestion 2024-04-29 15:02:12 +08:00
suggestion-raw-68962.stderr Add raw identifier in a typo suggestion 2024-04-29 15:02:12 +08:00
transitive-dep-span.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
transitive-dep-span.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-annotations-needed-expr.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-annotations-needed-expr.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
type-binding.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
type-binding.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
typo-suggestion.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
typo-suggestion.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
unused-warning-point-at-identifier.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
unused-warning-point-at-identifier.stderr Move /src/test to /tests 2023-01-11 09:32:08 +00:00
vec_refs_data_with_early_death.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
vec_refs_data_with_early_death.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
vec-must-not-hide-type-from-dropck.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
vec-must-not-hide-type-from-dropck.stderr Tweak E0597 2023-01-15 19:46:20 +00:00
visibility-ty-params.rs Resolve visibility paths as modules not as types. 2023-08-02 15:30:24 +00:00
visibility-ty-params.stderr Resolve visibility paths as modules not as types. 2023-08-02 15:30:24 +00:00
wf-method-late-bound-regions.rs Move /src/test to /tests 2023-01-11 09:32:08 +00:00
wf-method-late-bound-regions.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00