You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Note: you can also replicate this with this function signature.// fn foo<'a, 'b, 'c>(mut pair: (&'c mut &'a mut Vec<Option<String>>, &'b mut Vec<&'a mut Option<String>>)) {// let mut pair = (&mut a, &mut b);// }fnmain(){letmut a = Vec::new();letmut a = &mut a;letmut b = Vec::new();for _ inrange(0u8,9){//foo((&mut a, &mut b));// Correctly complains if you do: let (ref mut a, ref mut b) = (&mut a, &mut b);// Also correctly complains in Rust 0.12.let(&refmut a,refmut b) = (&mut a,&mut b);
a.push(Some("".to_string()));let index = a.len() - 1;let data = a.as_mut_slice().get_mut(index).unwrap();
b.push(data);}println!("{}", b);}