Skip to content

Unicode combining characters cause unnecessary warnings #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
euclio opened this issue Apr 13, 2016 · 1 comment
Closed

Unicode combining characters cause unnecessary warnings #924

euclio opened this issue Apr 13, 2016 · 1 comment

Comments

@euclio
Copy link
Contributor

euclio commented Apr 13, 2016

On formatting the following code with rustfmt:

fn main() {
    println!("{}", "क्षिक्षिक्षिक्षिक्षिक्षिक्षिक्षिक्षिक्षि");
}

It formats it as:

fn main() {
    println!("{}",
             "क्षिक्षिक्षिक्षिक्षिक्षिक्षिक्षिक्षिक्षि");
}

but outputs: src/lib.rs:3: line exceeded maximum length (sorry), when the line is clearly shorter than the threshold.

I think the problem lies in that rustfmt uses len_utf8() to calculate line length. It should probably use unicode grapheme clusters, but the underlying string buffer type doesn't support this.

@nrc nrc added the duplicate label Apr 13, 2016
@nrc
Copy link
Member

nrc commented Apr 13, 2016

Yeah, this is annoying, sorry.

Dup of #6

@nrc nrc closed this as completed Apr 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants