• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #[macro_use]
6 extern crate zerocopy;
7 
main()8 fn main() {}
9 
10 //
11 // AsBytes errors
12 //
13 
14 #[derive(AsBytes)]
15 #[repr(C)]
16 struct AsBytes1<T>(T);
17 
18 //
19 // Unaligned errors
20 //
21 
22 #[derive(Unaligned)]
23 #[repr(C, align(2))]
24 struct Unaligned1;
25 
26 #[derive(Unaligned)]
27 #[repr(transparent, align(2))]
28 struct Unaligned2 {
29     foo: u8,
30 }
31 
32 #[derive(Unaligned)]
33 #[repr(packed, align(2))]
34 struct Unaligned3;
35 
36 #[derive(Unaligned)]
37 #[repr(align(1), align(2))]
38 struct Unaligned4;
39 
40 #[derive(Unaligned)]
41 #[repr(align(2), align(4))]
42 struct Unaligned5;
43