Debian Codegraph @

gcc/testsuite/rust/compile/if_let_expr.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 pub enum Option<T> {
5 None,
6 Some(T),
7 }
8
9 fn main() {
10 let x = Option::Some(3);
11
12 let a = if let Option::Some(1) = x {// { dg-warning "unused name" }
13 1
14 } else if x == Option::Some(2) {
15 2
16 } else if let Option::Some(y) = x {
17 y
18 } else {
19 -1
20 };
21 }