blob: ca512ac7119055017538f31f7a89b0c3905d1ad1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
// check-pass
const fn foo((Ok(a) | Err(a)): Result<i32, i32>) {
let x = Ok(3);
let (Ok(y) | Err(y)) = x;
}
const X: () = {
let x = Ok(3);
let (Ok(y) | Err(y)) = x;
};
static Y: () = {
let x = Ok(3);
let (Ok(y) | Err(y)) = x;
};
static mut Z: () = {
let x = Ok(3);
let (Ok(y) | Err(y)) = x;
};
fn main() {
let _: [(); {
let x = Ok(3);
let (Ok(y) | Err(y)) = x;
2
}];
}
|