Closed
Description
$ 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
Activity
hcpl commentedon Oct 11, 2017
GitHub renders fullwidth characters with width less than 2 monospace cells - the span actually starts under the last string char and ends under the
1
digit.zackmdavis commentedon Oct 11, 2017
possibly related to #44080?
hcpl commentedon Oct 11, 2017
@zackmdavis
yeah, totally. Also as revealed in #8706 this is likely the same issue which dates back to August 2013.#21492 seems more appropriate than #8706 according to some comments there -
and that should have been fixed by #21499 (as reported here).Reverted by #24428 (info) => #8706 and #21492 still relevant (silly me, forgot looking at the latest comments in #8706).
Should I close it to decrease the noise/signal ratio or keep it to tell maintainers that this issue is persistent?
estebank commentedon Oct 12, 2017
Just want to point out that the RLS, which is being distributed with the compiler, transitively depends on
unicode-width
due to a dependency onclap
. I don't remember now if there was decision on avoiding depending on the externalunicode-*
crates that would allow the compiler to properly account for this. I think part of the discussions predates buildingrustc
with cargo. @alexcrichton, if we don't mind adding that dependency, we can use the existing PRs previously fixing this to solve this once and for all. Thoughts?alexcrichton commentedon Oct 12, 2017
Oh certainly, adding a dependency on
unicode-width
would be totally ok!