You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a struct is defined elsewhere, it won't get resolved in a pattern match. @pcwalton
Testcase
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 }
}
Error
test.rs:2:16: 2:32 error: `buildings::Tower` does not name a structure
test.rs:2 let sears = buildings::Tower { height: 1451 };
^~~~~~~~~~~~~~~~
test.rs:5:8: 5:26 error: `buildings::Tower` does not name a structure
test.rs:5 ::buildings::Tower { height: h } => { h }
^~~~~~~~~~~~~~~~~~
test.rs:5:37: 5:38 error: unresolved name: h
test.rs:5 ::buildings::Tower { height: h } => { h }
^
test.rs:5:46: 5:47 error: unresolved name: h
test.rs:5 ::buildings::Tower { height: h } => { h }
The text was updated successfully, but these errors were encountered:
If a struct is defined elsewhere, it won't get resolved in a pattern match. @pcwalton
Testcase
Error
The text was updated successfully, but these errors were encountered: