3 #![feature(rustc_attrs)]
10 // This testcase ensures that nested closures are handles properly
11 // - The nested closure is analyzed first.
12 // - The capture kind of the nested closure is accounted for by the enclosing closure
13 // - Any captured path by the nested closure that starts off a local variable in the enclosing
14 // closure is not listed as a capture of the enclosing closure.
17 let mut p = Point { x: 5, y: 20 };
19 let mut c1 = #[rustc_capture_analysis]
20 //~^ ERROR: attributes on expressions are experimental
21 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
23 //~^ ERROR: First Pass analysis includes:
24 //~| ERROR: Min Capture analysis includes:
26 //~^ NOTE: Capturing p[(0, 0)] -> ImmBorrow
27 //~| NOTE: Min Capture p[(0, 0)] -> ImmBorrow
29 let mut c2 = #[rustc_capture_analysis]
30 //~^ ERROR: attributes on expressions are experimental
31 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
33 //~^ ERROR: First Pass analysis includes:
34 //~| ERROR: Min Capture analysis includes:
35 //~| NOTE: Capturing p[(1, 0)] -> MutBorrow
36 //~| NOTE: Capturing incr[] -> ImmBorrow
37 //~| NOTE: Min Capture p[(1, 0)] -> MutBorrow
38 //~| NOTE: Min Capture incr[] -> ImmBorrow
39 //~| NOTE: Capturing p[(1, 0)] -> MutBorrow
40 //~| NOTE: Min Capture p[(1, 0)] -> MutBorrow
43 //~^ NOTE: Capturing p[(1, 0)] -> ImmBorrow