1 #![feature(capture_disjoint_fields)]
2 //~^ WARNING the feature `capture_disjoint_fields` is incomplete
3 #![feature(rustc_attrs)]
5 // Test to ensure that we can handle cases where
6 // let statements create no bindings are intialized
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 so the test
18 let p = Point { x: 10, y: 20 };
20 let c = #[rustc_capture_analysis]
21 //~^ ERROR: attributes on expressions are experimental
23 // FIXME(arora-aman): Change `_x` to `_`
24 let Point { x: _x, y: _ } = p;
25 //~^ ERROR: Capturing p[(0, 0)] -> ImmBorrow
26 //~| ERROR: Min Capture p[(0, 0)] -> ImmBorrow
33 let t = (String::new(), 10);
35 let c = #[rustc_capture_analysis]
36 //~^ ERROR: attributes on expressions are experimental
38 // FIXME(arora-aman): Change `_x` to `_`
40 //~^ ERROR: Capturing t[(0, 0)] -> ByValue
41 //~| ERROR: Min Capture t[(0, 0)] -> ByValue
48 let arr = [String::new(), String::new()];
50 let c = #[rustc_capture_analysis]
51 //~^ ERROR: attributes on expressions are experimental
53 // FIXME(arora-aman): Change `_x` to `_`
55 //~^ ERROR: Capturing arr[Index] -> ByValue
56 //~| ERROR: Min Capture arr[] -> ByValue