Created
May 22, 2014 00:45
-
-
Save bstrie/ef677f8e0c2fe9c91609 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Foo::Bar; | |
mod Foo { | |
pub struct Bar { | |
pub x: int, | |
y: int | |
} | |
impl Bar { | |
pub fn new(new_x: int, new_y: int) -> Bar { | |
Bar { x: new_x, y: new_y } | |
} | |
} | |
} | |
impl Bar { | |
fn set_x(&self, new_x: int) { | |
self.x = new_x; | |
} | |
} | |
fn main() { | |
let bar = Bar::new(1, 2); // error: unresolved name `Bar::new`. | |
println!("{}", bar.x); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment