-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Issues with non-ascii identifiers #18791
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
Comments
Using the following code I cannot reproduce the error on Linux (w/ rustc from most recent commit: a2f303a).
|
Hmm weird, rustc has no problem but cargo does. I'm using the rust-nightly and cargo-nightly packages from https://github.com/tomcheung789/homebrew-rust, which appear to download and compile the sources directly from https://static.rust-lang.org/dist/rust-nightly.tar.gz and https://github.com/rust-lang/cargo/archive/master.tar.gz respectively. The full error I get is
I assumed cargo used the same rustc binary. I ran cargo in verbose mode and found out that running |
Minimized down to #![feature(non_ascii_idents)]
struct C { θ: u8 }
fn main() {
let x = C { θ: 0 };
(|c: C| c.θ )(x);
} The backtrace is shown at the end of this post. Interestingly, we don't hit the ICE with this variation (note the braces to form a closure!) #![feature(non_ascii_idents)]
struct C { θ: u8 }
fn main() {
let x = C { θ: 0 };
(|c: C| {c.θ} )(x);
} I suspect a closure w/o braces might violate the assumption of this piece of code in pub fn get_cleanup_debug_loc_for_ast_node(...
...
let cleanup_span = if is_block {
Span {
lo: node_span.hi - codemap::BytePos(1), // closing brace should always be 1 byte...
hi: node_span.hi,
expn_id: node_span.expn_id
}
... @michaelwoerister Can you have a look at it?
|
Good catch, @nodakai! |
…ling. Also see issue rust-lang#18791.
fix: avoid generating colliding names in extract_variable
I've been playing around with non-ascii identifiers, and I found a (compiler) bug where the following doesn't work:
But this works fine:
The problem is in
|d| d.θ
, as I use structs with non-ascii idents elsewhere without problems. The error given is'rustc' panicked at 'assertion failed: bpos.to_uint() >= mbc.pos.to_uint() + mbc.bytes', /private/tmp/rust-nightly-lvT20f/rust-nightly/src/libsyntax/codemap.rs:471
My OS is OS X 10.10, my verbose version is just reported as rustc 0.13.0-dev, but I should be using the 2014-11-08 nightly build.
The text was updated successfully, but these errors were encountered: