Thanks. For the sake of completeness, here is the fixed version:
---- test-crate.rc ----
mod file1;
mod file2;
fn main() {
file1::bar();
}
------ file1.rs --------
use file2::HasInt;
struct X {
x : int
}
impl HasInt for X {
fn foo(&self) -> int {
self.x
}
}
pub fn bar() -> int {
let x = X{x : 10};
x.foo()
}
----- file2.rs ------
pub trait HasInt {
fn foo(&self) -> int;
}
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev