]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/issue-15774.rs
e2f42278cbcb16f7d5367d913d05f15dce509b2d
[rust.git] / src / test / run-pass / issue-15774.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
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
11 #![deny(warnings)]
12 #![allow(unused_imports)]
13
14 pub enum Foo { A }
15 mod bar {
16     pub fn normal(x: ::Foo) {
17         use Foo::A;
18         match x {
19             A => {}
20         }
21     }
22     pub fn wrong(x: ::Foo) {
23         match x {
24             ::Foo::A => {}
25         }
26     }
27 }
28
29 pub fn main() {
30     bar::normal(Foo::A);
31     bar::wrong(Foo::A);
32 }