2020-05-21 14:49:38 -05:00
|
|
|
//@ check-pass
|
2019-12-24 10:43:17 -06:00
|
|
|
|
|
|
|
const fn foo((Ok(a) | Err(a)): Result<i32, i32>) {
|
|
|
|
let x = Ok(3);
|
2021-02-12 18:04:37 -06:00
|
|
|
let (Ok(y) | Err(y)) = x;
|
2019-12-24 10:43:17 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
const X: () = {
|
|
|
|
let x = Ok(3);
|
2021-02-12 18:04:37 -06:00
|
|
|
let (Ok(y) | Err(y)) = x;
|
2019-12-24 10:43:17 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static Y: () = {
|
|
|
|
let x = Ok(3);
|
2021-02-12 18:04:37 -06:00
|
|
|
let (Ok(y) | Err(y)) = x;
|
2019-12-24 10:43:17 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
static mut Z: () = {
|
|
|
|
let x = Ok(3);
|
2021-02-12 18:04:37 -06:00
|
|
|
let (Ok(y) | Err(y)) = x;
|
2019-12-24 10:43:17 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let _: [(); {
|
|
|
|
let x = Ok(3);
|
2021-02-12 18:04:37 -06:00
|
|
|
let (Ok(y) | Err(y)) = x;
|
2019-12-24 10:43:17 -06:00
|
|
|
2
|
|
|
|
}];
|
|
|
|
}
|