3 #![feature(rustc_attrs)]
6 Point(i32, i32, String),
7 Meta(String, Vec<(i32, i32)>)
10 fn multi_variant_enum() {
11 let point = Info::Point(10, -10, "1".into());
14 let meta = Info::Meta("meta".into(), vec);
16 let c = #[rustc_capture_analysis]
17 //~^ ERROR: attributes on expressions are experimental
18 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
20 //~^ First Pass analysis includes:
21 //~| Min Capture analysis includes:
22 if let Info::Point(_, _, str) = point {
23 //~^ NOTE: Capturing point[] -> ImmBorrow
24 //~| NOTE: Capturing point[(2, 0)] -> ByValue
25 //~| NOTE: Min Capture point[] -> ByValue
29 if let Info::Meta(_, v) = meta {
30 //~^ NOTE: Capturing meta[] -> ImmBorrow
31 //~| NOTE: Capturing meta[(1, 1)] -> ByValue
32 //~| NOTE: Min Capture meta[] -> ByValue
41 Point(i32, i32, String),
44 fn single_variant_enum() {
45 let point = SingleVariant::Point(10, -10, "1".into());
47 let c = #[rustc_capture_analysis]
48 //~^ ERROR: attributes on expressions are experimental
49 //~| NOTE: see issue #15701 <https://github.com/rust-lang/rust/issues/15701>
51 //~^ First Pass analysis includes:
52 //~| Min Capture analysis includes:
53 let SingleVariant::Point(_, _, str) = point;
54 //~^ NOTE: Capturing point[(2, 0)] -> ByValue
55 //~| NOTE: Min Capture point[(2, 0)] -> ByValue