Debian Codegraph @

debian/missing-sources/zerocopy-derive/src/output_tests/expected/from_bytes_union.expected.rs

raw
1 #[allow(
2 deprecated,
3 private_bounds,
4 non_local_definitions,
5 non_camel_case_types,
6 non_upper_case_globals,
7 non_snake_case,
8 non_ascii_idents,
9 clippy::missing_inline_in_public_items,
10 )]
11 #[deny(ambiguous_associated_items)]
12 #[automatically_derived]
13 const _: () = {
14 unsafe impl ::zerocopy::TryFromBytes for Foo
15 where
16 u8: ::zerocopy::TryFromBytes,
17 {
18 fn only_derive_is_allowed_to_implement_this_trait() {}
19 fn is_bit_valid(
20 _candidate: ::zerocopy::Maybe<Self>,
21 ) -> ::zerocopy::util::macro_util::core_reexport::primitive::bool {
22 if false {
23 fn assert_is_from_bytes<T>()
24 where
25 T: ::zerocopy::FromBytes,
26 T: ?::zerocopy::util::macro_util::core_reexport::marker::Sized,
27 {}
28 assert_is_from_bytes::<Self>();
29 }
30 true
31 }
32 }
33 #[allow(
34 deprecated,
35 private_bounds,
36 non_local_definitions,
37 non_camel_case_types,
38 non_upper_case_globals,
39 non_snake_case,
40 non_ascii_idents,
41 clippy::missing_inline_in_public_items,
42 )]
43 #[deny(ambiguous_associated_items)]
44 #[automatically_derived]
45 const _: () = {
46 enum ẕa {}
47 #[allow(
48 deprecated,
49 private_bounds,
50 non_local_definitions,
51 non_camel_case_types,
52 non_upper_case_globals,
53 non_snake_case,
54 non_ascii_idents,
55 clippy::missing_inline_in_public_items,
56 )]
57 #[deny(ambiguous_associated_items)]
58 #[automatically_derived]
59 const _: () = {
60 unsafe impl ::zerocopy::HasTag for Foo {
61 fn only_derive_is_allowed_to_implement_this_trait() {}
62 type Tag = ();
63 type ProjectToTag = ::zerocopy::pointer::cast::CastToUnit;
64 }
65 };
66 #[allow(
67 deprecated,
68 private_bounds,
69 non_local_definitions,
70 non_camel_case_types,
71 non_upper_case_globals,
72 non_snake_case,
73 non_ascii_idents,
74 clippy::missing_inline_in_public_items,
75 )]
76 #[deny(ambiguous_associated_items)]
77 #[automatically_derived]
78 const _: () = {
79 unsafe impl ::zerocopy::HasField<
80 ẕa,
81 { ::zerocopy::UNION_VARIANT_ID },
82 { ::zerocopy::ident_id!(a) },
83 > for Foo {
84 fn only_derive_is_allowed_to_implement_this_trait() {}
85 type Type = u8;
86 #[inline(always)]
87 fn project(
88 slf: ::zerocopy::pointer::PtrInner<'_, Self>,
89 ) -> *mut <Self as ::zerocopy::HasField<
90 ẕa,
91 { ::zerocopy::UNION_VARIANT_ID },
92 { ::zerocopy::ident_id!(a) },
93 >>::Type {
94 let slf = slf.as_ptr();
95 unsafe {
96 ::zerocopy::util::macro_util::core_reexport::ptr::addr_of_mut!(
97 (* slf).a
98 )
99 }
100 }
101 }
102 };
103 };
104 };
105 #[allow(
106 deprecated,
107 private_bounds,
108 non_local_definitions,
109 non_camel_case_types,
110 non_upper_case_globals,
111 non_snake_case,
112 non_ascii_idents,
113 clippy::missing_inline_in_public_items,
114 )]
115 #[deny(ambiguous_associated_items)]
116 #[automatically_derived]
117 const _: () = {
118 unsafe impl ::zerocopy::FromZeros for Foo
119 where
120 u8: ::zerocopy::FromZeros,
121 {
122 fn only_derive_is_allowed_to_implement_this_trait() {}
123 }
124 };
125 #[allow(
126 deprecated,
127 private_bounds,
128 non_local_definitions,
129 non_camel_case_types,
130 non_upper_case_globals,
131 non_snake_case,
132 non_ascii_idents,
133 clippy::missing_inline_in_public_items,
134 )]
135 #[deny(ambiguous_associated_items)]
136 #[automatically_derived]
137 const _: () = {
138 unsafe impl ::zerocopy::FromBytes for Foo
139 where
140 u8: ::zerocopy::FromBytes,
141 {
142 fn only_derive_is_allowed_to_implement_this_trait() {}
143 }
144 };