]> git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/variant-namespacing.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / variant-namespacing.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 // aux-build:variant-namespacing.rs
12
13 enum E {
14 Struct { a: u8 },
15 Tuple(u8),
16 Unit,
17 }
18
19 type Struct = u8;
20 type Tuple = u8;
21 type Unit = u8;
22 type XStruct = u8;
23 type XTuple = u8;
24 type XUnit = u8;
25
26 const Struct: u8 = 0;
27 const Tuple: u8 = 0;
28 const Unit: u8 = 0;
29 const XStruct: u8 = 0;
30 const XTuple: u8 = 0;
31 const XUnit: u8 = 0;
32
33 extern crate variant_namespacing;
34 pub use variant_namespacing::XE::*;
35 //~^ ERROR `XStruct` has already been defined
36 //~| ERROR `XStruct` has already been defined
37 //~| ERROR `XTuple` has already been defined
38 //~| ERROR `XTuple` has already been defined
39 //~| ERROR `XUnit` has already been defined
40 //~| ERROR `XUnit` has already been defined
41 pub use E::*;
42 //~^ ERROR `Struct` has already been defined
43 //~| ERROR `Struct` has already been defined
44 //~| ERROR `Tuple` has already been defined
45 //~| ERROR `Tuple` has already been defined
46 //~| ERROR `Unit` has already been defined
47 //~| ERROR `Unit` has already been defined
48
49 fn main() {}