3 #![feature(rustc_attrs)]
5 // Test to ensure that we can handle cases where
6 // let statements create no bindings are initialized
7 // using a Place expression
9 // Note: Currently when feature `capture_disjoint_fields` is enabled
10 // we can't handle such cases. So the test current use `_x` instead of
11 // `_` until the issue is resolved.
12 // Check rust-lang/project-rfc-2229#24 for status.
20 let p = Point { x: 10, y: 20 };
22 let c = #[rustc_capture_analysis]
23 //~^ ERROR: attributes on expressions are experimental
24 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
26 //~^ ERROR: First Pass analysis includes:
27 //~| ERROR: Min Capture analysis includes:
28 // FIXME(arora-aman): Change `_x` to `_`
29 let Point { x: _x, y: _ } = p;
30 //~^ NOTE: Capturing p[(0, 0)] -> ImmBorrow
31 //~| NOTE: Min Capture p[(0, 0)] -> ImmBorrow
38 let t = (String::new(), 10);
40 let c = #[rustc_capture_analysis]
41 //~^ ERROR: attributes on expressions are experimental
42 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
44 //~^ ERROR: First Pass analysis includes:
45 //~| ERROR: Min Capture analysis includes:
46 // FIXME(arora-aman): Change `_x` to `_`
48 //~^ NOTE: Capturing t[(0, 0)] -> ByValue
49 //~| NOTE: Min Capture t[(0, 0)] -> ByValue
56 let arr = [String::new(), String::new()];
58 let c = #[rustc_capture_analysis]
59 //~^ ERROR: attributes on expressions are experimental
60 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
62 //~^ ERROR: First Pass analysis includes:
63 //~| ERROR: Min Capture analysis includes:
64 // FIXME(arora-aman): Change `_x` to `_`
66 //~^ NOTE: Capturing arr[Index] -> ByValue
67 //~| NOTE: Min Capture arr[] -> ByValue