summaryrefslogblamecommitdiffstats
path: root/examples/17_borrow-error-fixed.rs
blob: 06ff06044c856d9d0ea6c061265bf2c0de716568 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                       
fn foo () -> Box<int> {
    let x = box 2;
    return x;
}

fn main () {
    let x = foo();
    println!("{}", *x);
}