1 // check that accesses due to a closure capture give a special note
5 fn closure_imm_capture_conflict(mut x: i32) {
11 fn closure_mut_capture_conflict(mut x: i32) {
17 fn closure_unique_capture_conflict(mut x: &mut i32) {
23 fn closure_copy_capture_conflict(mut x: i32) {
29 fn closure_move_capture_conflict(mut x: String) {
35 fn closure_imm_capture_moved(mut x: String) {
40 fn closure_mut_capture_moved(mut x: String) {
42 || x = String::new(); //~ ERROR
45 fn closure_unique_capture_moved(x: &mut String) {
47 || *x = String::new(); //~ ERROR
50 fn closure_move_capture_moved(x: &mut String) {
57 trait Fake { fn use_mut(&mut self) { } fn use_ref(&self) { } }
58 impl<T> Fake for T { }