]> git.lizzy.rs Git - rust.git/blob - tests/ui-fulldeps/deriving-global.rs
make more readable
[rust.git] / tests / ui-fulldeps / deriving-global.rs
1 // run-pass
2
3 #![feature(rustc_private)]
4
5 extern crate rustc_macros;
6 extern crate rustc_serialize;
7
8 // Necessary to pull in object code as the rest of the rustc crates are shipped only as rmeta
9 // files.
10 #[allow(unused_extern_crates)]
11 extern crate rustc_driver;
12
13 mod submod {
14     use rustc_macros::{Decodable, Encodable};
15
16     // if any of these are implemented without global calls for any
17     // function calls, then being in a submodule will (correctly)
18     // cause errors about unrecognised module `std` (or `extra`)
19     #[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone, Debug, Encodable, Decodable)]
20     enum A {
21         A1(usize),
22         A2(isize),
23     }
24
25     #[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone, Debug, Encodable, Decodable)]
26     struct B {
27         x: usize,
28         y: isize,
29     }
30
31     #[derive(PartialEq, PartialOrd, Eq, Ord, Hash, Clone, Debug, Encodable, Decodable)]
32     struct C(usize, isize);
33 }
34
35 pub fn main() {}