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