1 // check that accesses due to a closure capture give a special note
3 fn closure_imm_capture_conflict(mut x
: i32) {
9 fn closure_mut_capture_conflict(mut x
: i32) {
15 fn closure_unique_capture_conflict(mut x
: &mut i32) {
21 fn closure_copy_capture_conflict(mut x
: i32) {
27 fn closure_move_capture_conflict(mut x
: String
) {
33 fn closure_imm_capture_moved(mut x
: String
) {
38 fn closure_mut_capture_moved(mut x
: String
) {
40 || x
= String
::new(); //~ ERROR
43 fn closure_unique_capture_moved(x
: &mut String
) {
45 || *x
= String
::new(); //~ ERROR
48 fn closure_move_capture_moved(x
: &mut String
) {
55 trait Fake { fn use_mut(&mut self) { }
fn use_ref(&self) { }
}
56 impl<T
> Fake
for T { }