()
| 124 | fn local_struct_variable_destructured() { |
| 125 | compile_ok( |
| 126 | r#" |
| 127 | main: () -> i32 { |
| 128 | p: { x: i32, y: i32 } = { .x = 10, .y = 20 } |
| 129 | { x: i32, y: i32 } = p |
| 130 | return x + y |
| 131 | } |
| 132 | "#, |
| 133 | ); |
| 134 | } |
| 135 | |
| 136 | // -- Composition and context --------------------------------------------------- |
| 137 | |
| 138 | #[test] |
| 139 | fn destructure_inside_if_branch() { |
| 140 | compile_ok( |
| 141 | r#" |
nothing calls this directly
no test coverage detected