]> git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/issue-6936.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / issue-6936.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 struct T;
12
13 mod t1 {
14 type Foo = ::T;
15 mod Foo {} //~ ERROR: `Foo` has already been defined
16 }
17
18 mod t2 {
19 type Foo = ::T;
20 struct Foo; //~ ERROR: `Foo` has already been defined
21 }
22
23 mod t3 {
24 type Foo = ::T;
25 enum Foo {} //~ ERROR: `Foo` has already been defined
26 }
27
28 mod t4 {
29 type Foo = ::T;
30 fn Foo() {} // ok
31 }
32
33 mod t5 {
34 type Bar<T> = T;
35 mod Bar {} //~ ERROR: `Bar` has already been defined
36 }
37
38 mod t6 {
39 type Foo = ::T;
40 impl Foo {} // ok
41 }
42
43
44 fn main() {}