]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/issue-30302.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / issue-30302.rs
CommitLineData
1a4d82fc 1// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
223e47cc
LB
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
9cc50fc6
SL
11enum Stack<T> {
12 Nil,
13 Cons(T, Box<Stack<T>>)
62682a34
SL
14}
15
9cc50fc6
SL
16fn is_empty<T>(s: Stack<T>) -> bool {
17 match s {
18 Nil => true,
19//~^ WARN pattern binding `Nil` is named the same as one of the variants of the type `Stack`
20//~| HELP consider making the path in the pattern qualified: `Stack::Nil`
54a0048b 21//~| HELP run `rustc --explain E0170` to see a detailed explanation
9cc50fc6
SL
22 _ => false
23//~^ ERROR unreachable pattern
54a0048b 24//~| HELP run `rustc --explain E0001` to see a detailed explanation
9cc50fc6 25 }
62682a34 26}
223e47cc
LB
27
28fn main() {}