Skip to content

Account for unicode char width when calculating vertical label lines #66552

Closed
@estebank

Description

@estebank

In ui/terminal-width/non-whitespace-trimming-unicode.stderr we account for the visible char width when calculating the label and span positions, but we do not do so for the vertical bar tying them together, causing the following output:

error[E0308]: mismatched types
  --> $DIR/non-whitespace-trimming-unicode.rs:4:415
   |
LL | ...♬♭♮♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42;  let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓  ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃...
   |                                             --   ^^ expected (), found integer
   |                                                      |
   |                                             expected due to this
   |
   = note: expected type `()`
              found type `{integer}`

error: aborting due to previous error

where it should be

error[E0308]: mismatched types
  --> $DIR/non-whitespace-trimming-unicode.rs:4:415
   |
LL | ...♬♭♮♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42;  let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓  ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃...
   |                                             --   ^^ expected (), found integer
   |                                             |
   |                                             expected due to this
   |
   = note: expected type `()`
              found type `{integer}`

error: aborting due to previous error

(Found during #66539)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-UnicodeArea: UnicodeA-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions