1 // Copyright 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.
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.
13 #![warn(variant_size_differences)]
16 // Note that the following test works because all fields of the enum variants are of the same size.
17 // If this test is modified and the reordering logic in librustc/ty/layout.rs kicks in, it fails.
21 enum Enum2 { A, B, C }
23 enum Enum3 { D(i64), E, F }
25 enum Enum4 { H(i64), I(i64), J }
28 L(i64, i64, i64, i64), //~ WARNING three times larger
39 #[allow(variant_size_differences)]
41 R(i64, i64, i64, i64),