Skip to content

Error span is in incorrect place due to Unicode fullwidth characters #45211

Closed
@hcpl

Description

@hcpl
$ rustc +nightly --version
rustc 1.22.0-nightly (d6d711dd8 2017-10-10)
$ uname -sri
Linux 4.2.0-42-generic x86_64

Code:

fn main() {
    let _ = ("こんにちは", 100i40);
}

rustc output:

error: invalid width `40` for integer literal
 --> main.rs:2:23
  |
2 |     let _ = ("こんにちは", 100i40);
  |                       ^^^^^^
  |
  = help: valid widths are 8, 16, 32, 64 and 128

error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions