Closed
Description
Adding a leading ::
to buildings::Tower
will avoid parse errors, though this error has been seen for cross-crate struct uses as well. Is there a reason for this? At the least, the error message should make more sense.
Test case
fn main() {
let sears = buildings::Tower { height: 1451 };
let h: uint = match sears {
buildings::Tower { height: h } => { h }
}
io::println(h.to_str());
}
mod buildings {
struct Tower { height: uint }
}
Output
[burg@host-7-150 Desktop]# rustc test.rs
test.rs:4:25: 4:26 error: expected `=>` but found `{`
test.rs:4 buildings::Tower { height: h } => { h }
^