]> git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/issue-21546.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / issue-21546.rs
1 // Copyright 2015 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 // Also works as a test for #14564
12
13 #[allow(non_snake_case)]
14 mod Foo { }
15 //~^ NOTE previous definition of `Foo` here
16
17 #[allow(dead_code)]
18 struct Foo;
19 //~^ ERROR a module named `Foo` has already been defined in this module
20
21 #[allow(non_snake_case)]
22 mod Bar { }
23 //~^ NOTE previous definition of `Bar` here
24
25 #[allow(dead_code)]
26 struct Bar(i32);
27 //~^ ERROR a module named `Bar` has already been defined
28
29
30 #[allow(dead_code)]
31 struct Baz(i32);
32 //~^ NOTE previous definition
33
34 #[allow(non_snake_case)]
35 mod Baz { }
36 //~^ ERROR a type named `Baz` has already been defined
37
38
39 #[allow(dead_code)]
40 struct Qux { x: bool }
41 //~^ NOTE previous definition
42
43 #[allow(non_snake_case)]
44 mod Qux { }
45 //~^ ERROR a type named `Qux` has already been defined
46
47
48 #[allow(dead_code)]
49 struct Quux;
50 //~^ NOTE previous definition
51
52 #[allow(non_snake_case)]
53 mod Quux { }
54 //~^ ERROR a type named `Quux` has already been defined
55
56
57 #[allow(dead_code)]
58 enum Corge { A, B }
59 //~^ NOTE previous definition
60
61 #[allow(non_snake_case)]
62 mod Corge { }
63 //~^ ERROR a type named `Corge` has already been defined
64
65 fn main() { }