Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upIssues with non-ascii identifiers #18791
Comments
This comment has been minimized.
This comment has been minimized.
soltanmm
commented
Nov 9, 2014
|
Using the following code I cannot reproduce the error on Linux (w/ rustc from most recent commit: a2f303a).
|
This comment has been minimized.
This comment has been minimized.
|
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 |
huonw
added
the
I-ICE
label
Nov 12, 2014
This comment has been minimized.
This comment has been minimized.
|
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?
|
michaelwoerister
added
the
A-debuginfo
label
Nov 27, 2014
This comment has been minimized.
This comment has been minimized.
|
Good catch, @nodakai! |
sourtin commentedNov 9, 2014
I've been playing around with non-ascii identifiers, and I found a (compiler) bug where the following doesn't work:
Struct Coord { t: f64, θ: f64 } let data: Vec<Coord> = simulate(...); let t = data.iter().map(|d| d.t); let θ = data.iter().map(|d| d.θ);But this works fine:
Struct Coord { t: f64, u: f64 } let data: Vec<Coord> = simulate(...); let t = data.iter().map(|d| d.t); let θ = data.iter().map(|d| d.u);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:471My 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.