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

13 lines
155 B
Rust

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