Title: Samsung Enterprise Portal mySingle

Hi All,

Rust Compiler is giving error in following code :-

 

fn main() {

 let mut vec = ~[1 ,2 , 3, 4];
 
 f1(&mut vec);

}

fn f1 (b: &mut ~[int]) {

 let mut a = &mut b[0];
 //process(a);
 
 a = &mut b[3];
}

 

error: cannot borrow '(**b)[]' as mutable more than once at a time

 

Thanks and Regards,

Piyush Agarwal

 

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to