]> git.proxmox.com Git - rustc.git/blob - src/test/run-pass/xcrate-unit-struct.rs
Imported Upstream version 1.0.0~beta
[rustc.git] / src / test / run-pass / xcrate-unit-struct.rs
1 // Copyright 2013-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 // aux-build:xcrate_unit_struct.rs
12 // pretty-expanded FIXME #23616
13
14 extern crate xcrate_unit_struct;
15
16 const s1: xcrate_unit_struct::Struct = xcrate_unit_struct::Struct;
17 static s2: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::UnitVariant;
18 static s3: xcrate_unit_struct::Unit =
19 xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct);
20 static s4: xcrate_unit_struct::Unit = xcrate_unit_struct::Unit::Argument(s1);
21 static s5: xcrate_unit_struct::TupleStruct = xcrate_unit_struct::TupleStruct(20, "foo");
22
23 fn f1(_: xcrate_unit_struct::Struct) {}
24 fn f2(_: xcrate_unit_struct::Unit) {}
25 fn f3(_: xcrate_unit_struct::TupleStruct) {}
26
27 pub fn main() {
28 f1(xcrate_unit_struct::Struct);
29 f2(xcrate_unit_struct::Unit::UnitVariant);
30 f2(xcrate_unit_struct::Unit::Argument(xcrate_unit_struct::Struct));
31 f3(xcrate_unit_struct::TupleStruct(10, "bar"));
32
33 f1(s1);
34 f2(s2);
35 f2(s3);
36 f2(s4);
37 f3(s5);
38 }