4fc0452ace
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
18 lines
249 B
Rust
18 lines
249 B
Rust
struct S {
|
|
x: ~int
|
|
}
|
|
|
|
impl S {
|
|
pub fn foo(self) -> int {
|
|
self.bar();
|
|
return *self.x; //~ ERROR use of moved value: `self`
|
|
}
|
|
|
|
pub fn bar(self) {}
|
|
}
|
|
|
|
fn main() {
|
|
let x = S { x: ~1 };
|
|
println!("{}", x.foo());
|
|
}
|