Add a test to see if tuple struct gets combined
This commit is contained in:
parent
809e06ee32
commit
dc035bbbee
2 changed files with 26 additions and 0 deletions
|
@ -48,3 +48,18 @@ fn issue_1874() {
|
||||||
y
|
y
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn combine_patterns() {
|
||||||
|
let x = match y {
|
||||||
|
Some(
|
||||||
|
Some(
|
||||||
|
Foo {
|
||||||
|
z: Bar(..),
|
||||||
|
a: Bar(..),
|
||||||
|
b: Bar(..),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
) => z,
|
||||||
|
_ => return,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
|
@ -63,3 +63,14 @@ fn issue_1874() {
|
||||||
y
|
y
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn combine_patterns() {
|
||||||
|
let x = match y {
|
||||||
|
Some(Some(Foo {
|
||||||
|
z: Bar(..),
|
||||||
|
a: Bar(..),
|
||||||
|
b: Bar(..),
|
||||||
|
})) => z,
|
||||||
|
_ => return,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue