-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
span information is mistaken in the presence of combining characters #3260
Comments
Yeah. Fixing this will have to wait on us binding to libICU in libstd, most likely. It's beyond the scope of the unicode-isms that libcore understands. |
Apart from combining characters, "wide" characters should be considered to occupy 2 columns. See http://www.unicode.org/reports/tr11/ for details. |
This seems to be fixed. |
Apologies for reviving this, but I think there's either been a mistake, a regression, or I've completely misunderstood the bug. When I compile use std::io;
fn main() {
let s = ~"ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; }
io::println(s);
} I get the a more or less equivalent diagnostic:
Crucially, the character span is still off; though it's now 46-67. Unless I'm missing something, it seems like this should be reopened? |
It's open as #8706. (The issue is we compute spans with codepoints, not graphemes.) |
Ah; thank you! This FIXME sent me to the wrong place, then: https://github.com/mozilla/rust/blob/master/src/libsyntax/diagnostic.rs#L316 |
Do not modify original source code inside macro call
Check if tier 2 targets build in the nightly cron job This PR adds a CI job that only runs nightly which will install Miri built from the latest commit, and try to build every Tier 2 without host tools target, as documented on https://doc.rust-lang.org/nightly/rustc/platform-support.html. I'm not really excited about the idea of scraping the tier 2 without host tools list, but also keeping the list up-to-date by hand seems prone to forgetting to update it. And that update seems like the sort of manual maintenance we should automate.
Related changes: - rust-lang#125910: Introduces a new constant propagation pass which broke Kani coverage tests. For now, disable this pass if coverage is enabled. - rust-lang#126410: Rename ConstOperands Resolves rust-lang#3260
rustc reckons spans in terms of unicode code points, which causes problems when faced with combining characters. When the following code is compiled
rustc will produce the following screwed up diagnostic:
emacs tells me that the while loop starts in column 23. (Interestingly, emacs seems to split up the combining characters when it displays them, presumably for easier editing, but doesn't advance the column numbers.)
The text was updated successfully, but these errors were encountered: