]> git.lizzy.rs Git - rust.git/blob - tests/ui/lint/issue-30302.rs
Rollup merge of #106244 - atouchet:readme3, r=workingjubilee
[rust.git] / tests / ui / lint / issue-30302.rs
1 #![allow(dead_code)]
2 #![allow(unused_variables)]
3 #![allow(non_snake_case)]
4 #![deny(unreachable_patterns)]
5
6 enum Stack<T> {
7     Nil,
8     Cons(T, Box<Stack<T>>)
9 }
10
11 fn is_empty<T>(s: Stack<T>) -> bool {
12     match s {
13         Nil => true,
14 //~^ WARN pattern binding `Nil` is named the same as one of the variants of the type `Stack`
15         _ => false
16 //~^ ERROR unreachable pattern
17     }
18 }
19
20 fn main() {}