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

13 lines
159 B
Rust

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