rust/src/test/run-pass/borrowck-wg-borrow-mut-to-imm.rs

13 lines
155 B
Rust
Raw Normal View History

fn g(x: &Option<int>) {
io::println(x.get().to_str());
}
fn f(x: &mut Option<int>) {
g(&*x);
}
fn main() {
let mut x = ~Some(3);
f(x);
}