1 // Copyright 2019 The Fuchsia Authors
2 //
3 // Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
4 // <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
5 // license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
6 // This file may not be copied, modified, or distributed except according to
7 // those terms.
8 
9 use zerocopy::{AsBytes, FromBytes, FromZeroes, KnownLayout, Unaligned};
10 
11 // These derives do not result in E0446 as of Rust 1.59.0, because of
12 // https://github.com/rust-lang/rust/pull/90586.
13 //
14 // This change eliminates one of the major downsides of emitting `where`
15 // bounds for field types (i.e., the emission of E0446 for private field
16 // types).
17 
18 #[derive(KnownLayout, AsBytes, FromZeroes, FromBytes, Unaligned)]
19 #[repr(C)]
20 pub struct Public(Private);
21 
22 #[derive(KnownLayout, AsBytes, FromZeroes, FromBytes, Unaligned)]
23 #[repr(C)]
24 struct Private(());
25