Make moves explicit in doc examples

Had to remove the buffalo example. It was awkward to update for
explicit moves.
This commit is contained in:
Tim Chevalier 2012-09-18 22:33:49 -07:00
parent d0ed13c4bd
commit ea5e3d21ff
4 changed files with 28 additions and 10 deletions

View file

@ -0,0 +1,13 @@
struct P { child: Option<@mut P> }
trait PTrait {
fn getChildOption() -> Option<@P>;
}
impl P: PTrait {
fn getChildOption() -> Option<@P> {
const childVal: @P = self.child.get();
fail;
}
}
fn main() {}

View file

@ -0,0 +1,5 @@
fn f(x:int) {
const child: int = x + 1;
}
fn main() {}