Sign in
android
/
toolchain
/
rustc
/
43f0694b1feb1296004d84509e01177159e71be0
/
.
/
src
/
test
/
ui
/
guards-not-exhaustive.rs
blob: b74f162c0c62225cb8dcb9c0fe0bea3148d9f3f6 [
file
] [
log
] [
blame
]
// run-pass
#![
allow
(
non_snake_case
)]
#[
derive
(
Copy
,
Clone
)]
enum
Q
{
R
(
Option
<
usize
>)
}
fn
xyzzy
(
q
:
Q
)
->
usize
{
match
q
{
Q
::
R
(
S
)
if
S
.
is_some
()
=>
{
0
}
_
=>
1
}
}
pub
fn
main
()
{
assert_eq
!(
xyzzy
(
Q
::
R
(
Some
(
5
))),
0
);
}