Debian Codegraph @

.cargo/vendor/zerocopy-derive/tests/paths_and_modules.rs

raw
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 // See comment in `include.rs` for why we disable the prelude.
10 #![no_implicit_prelude]
11 #![allow(warnings)]
12
13 include!("include.rs");
14
15 // Ensure that types that are use'd and types that are referenced by path work.
16
17 mod foo {
18 use super::*;
19
20 #[derive(imp::FromBytes, imp::IntoBytes, imp::Unaligned)]
21 #[repr(C)]
22 pub struct Foo {
23 foo: u8,
24 }
25
26 #[derive(imp::FromBytes, imp::IntoBytes, imp::Unaligned)]
27 #[repr(C)]
28 pub struct Bar {
29 bar: u8,
30 }
31 }
32
33 use foo::Foo;
34
35 #[derive(imp::FromBytes, imp::IntoBytes, imp::Unaligned)]
36 #[repr(C)]
37 struct Baz {
38 foo: Foo,
39 bar: foo::Bar,
40 }