facet/
sample_generated_code.rs

1//! This defines a few types showcasing various features of the Facet derive macro.
2#![allow(warnings)]
3#[prelude_import]
4use std::prelude::rust_2024::*;
5extern crate std;
6
7use crate::Facet;
8
9/// A struct demonstrating various field types and attributes.
10pub struct KitchenSinkStruct {
11    /// A basic string field.
12    pub basic_field: String,
13    /// A field marked as sensitive.
14    pub sensitive_field: u64,
15    /// A tuple field.
16    pub tuple_field: (i32, bool),
17    /// An array field.
18    pub array_field: [u8; 4],
19    /// A static slice field.
20    pub slice_field: &'static [u8],
21    /// A vector field.
22    pub vec_field: Vec<f32>,
23    /// A field containing another struct that derives Facet.
24    pub nested_struct_field: Point,
25}
26#[used]
27static KITCHEN_SINK_STRUCT_SHAPE: &'static crate::Shape =
28    <KitchenSinkStruct as crate::Facet>::SHAPE;
29#[automatically_derived]
30unsafe impl crate::Facet for KitchenSinkStruct {
31    const SHAPE: &'static crate::Shape = &const {
32        let fields: &'static [crate::Field] = &const {
33            [
34                crate::Field::builder()
35                    .name("basic_field")
36                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.basic_field)))
37                    .offset({
38                        builtin # offset_of(KitchenSinkStruct<>, basic_field)
39                    })
40                    .flags(crate::FieldFlags::EMPTY)
41                    .attributes(&[])
42                    .doc(&[" A basic string field."])
43                    .build(),
44                crate::Field::builder()
45                    .name("sensitive_field")
46                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.sensitive_field)))
47                    .offset({
48                        builtin # offset_of(KitchenSinkStruct<>, sensitive_field)
49                    })
50                    .flags(crate::FieldFlags::SENSITIVE)
51                    .attributes(&[crate::FieldAttribute::Sensitive])
52                    .doc(&[" A field marked as sensitive."])
53                    .build(),
54                crate::Field::builder()
55                    .name("tuple_field")
56                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.tuple_field)))
57                    .offset({
58                        builtin # offset_of(KitchenSinkStruct<>, tuple_field)
59                    })
60                    .flags(crate::FieldFlags::EMPTY)
61                    .attributes(&[])
62                    .doc(&[" A tuple field."])
63                    .build(),
64                crate::Field::builder()
65                    .name("array_field")
66                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.array_field)))
67                    .offset({
68                        builtin # offset_of(KitchenSinkStruct<>, array_field)
69                    })
70                    .flags(crate::FieldFlags::EMPTY)
71                    .attributes(&[])
72                    .doc(&[" An array field."])
73                    .build(),
74                crate::Field::builder()
75                    .name("slice_field")
76                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.slice_field)))
77                    .offset({
78                        builtin # offset_of(KitchenSinkStruct<>, slice_field)
79                    })
80                    .flags(crate::FieldFlags::EMPTY)
81                    .attributes(&[])
82                    .doc(&[" A static slice field."])
83                    .build(),
84                crate::Field::builder()
85                    .name("vec_field")
86                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.vec_field)))
87                    .offset({
88                        builtin # offset_of(KitchenSinkStruct<>, vec_field)
89                    })
90                    .flags(crate::FieldFlags::EMPTY)
91                    .attributes(&[])
92                    .doc(&[" A vector field."])
93                    .build(),
94                crate::Field::builder()
95                    .name("nested_struct_field")
96                    .shape(|| crate::shape_of(&(|s: &KitchenSinkStruct| &s.nested_struct_field)))
97                    .offset({
98                        builtin # offset_of(KitchenSinkStruct<>,
99                                                                        nested_struct_field)
100                    })
101                    .flags(crate::FieldFlags::EMPTY)
102                    .attributes(&[])
103                    .doc(&[" A field containing another struct that derives Facet."])
104                    .build(),
105            ]
106        };
107        let vtable = &const {
108            let mut vtable = const {
109                let mut builder = ::facet_core::ValueVTable::builder()
110                    .type_name(|f, _opts| ::core::fmt::Write::write_str(f, "KitchenSinkStruct"))
111                    .drop_in_place(|data| unsafe { data.drop_in_place::<Self>() });
112                if {
113                    /// Fallback trait with `False` for `IMPLS` if the type does not
114                    /// implement the given trait.
115                    trait DoesNotImpl {
116                        const IMPLS: bool = false;
117                    }
118                    impl<T: ?Sized> DoesNotImpl for T {}
119                    /// Concrete type with `True` for `IMPLS` if the type implements the
120                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
121                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
122                    #[allow(dead_code)]
123                    impl<T: ?Sized + core::fmt::Display> Wrapper<T> {
124                        const IMPLS: bool = true;
125                    }
126                    <Wrapper<Self>>::IMPLS
127                } {
128                    builder = builder.display(|data, f| {
129                        use ::facet_core::spez::*;
130                        (&&Spez(unsafe { data.get::<Self>() })).spez_display(f)
131                    });
132                }
133                if {
134                    /// Fallback trait with `False` for `IMPLS` if the type does not
135                    /// implement the given trait.
136                    trait DoesNotImpl {
137                        const IMPLS: bool = false;
138                    }
139                    impl<T: ?Sized> DoesNotImpl for T {}
140                    /// Concrete type with `True` for `IMPLS` if the type implements the
141                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
142                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
143                    #[allow(dead_code)]
144                    impl<T: ?Sized + core::fmt::Debug> Wrapper<T> {
145                        const IMPLS: bool = true;
146                    }
147                    <Wrapper<Self>>::IMPLS
148                } {
149                    builder = builder.debug(|data, f| {
150                        use ::facet_core::spez::*;
151                        (&&Spez(unsafe { data.get::<Self>() })).spez_debug(f)
152                    });
153                }
154                if {
155                    /// Fallback trait with `False` for `IMPLS` if the type does not
156                    /// implement the given trait.
157                    trait DoesNotImpl {
158                        const IMPLS: bool = false;
159                    }
160                    impl<T: ?Sized> DoesNotImpl for T {}
161                    /// Concrete type with `True` for `IMPLS` if the type implements the
162                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
163                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
164                    #[allow(dead_code)]
165                    impl<T: ?Sized + core::default::Default> Wrapper<T> {
166                        const IMPLS: bool = true;
167                    }
168                    <Wrapper<Self>>::IMPLS
169                } {
170                    builder = builder.default_in_place(|target| {
171                        use ::facet_core::spez::*;
172                        unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_default_in_place(target) }
173                    });
174                }
175                if {
176                    /// Fallback trait with `False` for `IMPLS` if the type does not
177                    /// implement the given trait.
178                    trait DoesNotImpl {
179                        const IMPLS: bool = false;
180                    }
181                    impl<T: ?Sized> DoesNotImpl for T {}
182                    /// Concrete type with `True` for `IMPLS` if the type implements the
183                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
184                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
185                    #[allow(dead_code)]
186                    impl<T: ?Sized + core::clone::Clone> Wrapper<T> {
187                        const IMPLS: bool = true;
188                    }
189                    <Wrapper<Self>>::IMPLS
190                } {
191                    builder = builder.clone_into(|src, dst| {
192                        use ::facet_core::spez::*;
193                        unsafe { (&&Spez(src.get::<Self>())).spez_clone_into(dst) }
194                    });
195                }
196                {
197                    let mut traits = ::facet_core::MarkerTraits::empty();
198                    if {
199                        /// Fallback trait with `False` for `IMPLS` if the type does not
200                        /// implement the given trait.
201                        trait DoesNotImpl {
202                            const IMPLS: bool = false;
203                        }
204                        impl<T: ?Sized> DoesNotImpl for T {}
205                        /// Concrete type with `True` for `IMPLS` if the type implements the
206                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
207                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
208                        #[allow(dead_code)]
209                        impl<T: ?Sized + core::cmp::Eq> Wrapper<T> {
210                            const IMPLS: bool = true;
211                        }
212                        <Wrapper<Self>>::IMPLS
213                    } {
214                        traits = traits.union(::facet_core::MarkerTraits::EQ);
215                    }
216                    if {
217                        /// Fallback trait with `False` for `IMPLS` if the type does not
218                        /// implement the given trait.
219                        trait DoesNotImpl {
220                            const IMPLS: bool = false;
221                        }
222                        impl<T: ?Sized> DoesNotImpl for T {}
223                        /// Concrete type with `True` for `IMPLS` if the type implements the
224                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
225                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
226                        #[allow(dead_code)]
227                        impl<T: ?Sized + core::marker::Send> Wrapper<T> {
228                            const IMPLS: bool = true;
229                        }
230                        <Wrapper<Self>>::IMPLS
231                    } {
232                        traits = traits.union(::facet_core::MarkerTraits::SEND);
233                    }
234                    if {
235                        /// Fallback trait with `False` for `IMPLS` if the type does not
236                        /// implement the given trait.
237                        trait DoesNotImpl {
238                            const IMPLS: bool = false;
239                        }
240                        impl<T: ?Sized> DoesNotImpl for T {}
241                        /// Concrete type with `True` for `IMPLS` if the type implements the
242                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
243                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
244                        #[allow(dead_code)]
245                        impl<T: ?Sized + core::marker::Sync> Wrapper<T> {
246                            const IMPLS: bool = true;
247                        }
248                        <Wrapper<Self>>::IMPLS
249                    } {
250                        traits = traits.union(::facet_core::MarkerTraits::SYNC);
251                    }
252                    if {
253                        /// Fallback trait with `False` for `IMPLS` if the type does not
254                        /// implement the given trait.
255                        trait DoesNotImpl {
256                            const IMPLS: bool = false;
257                        }
258                        impl<T: ?Sized> DoesNotImpl for T {}
259                        /// Concrete type with `True` for `IMPLS` if the type implements the
260                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
261                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
262                        #[allow(dead_code)]
263                        impl<T: ?Sized + core::marker::Copy> Wrapper<T> {
264                            const IMPLS: bool = true;
265                        }
266                        <Wrapper<Self>>::IMPLS
267                    } {
268                        traits = traits.union(::facet_core::MarkerTraits::COPY);
269                    }
270                    if {
271                        /// Fallback trait with `False` for `IMPLS` if the type does not
272                        /// implement the given trait.
273                        trait DoesNotImpl {
274                            const IMPLS: bool = false;
275                        }
276                        impl<T: ?Sized> DoesNotImpl for T {}
277                        /// Concrete type with `True` for `IMPLS` if the type implements the
278                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
279                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
280                        #[allow(dead_code)]
281                        impl<T: ?Sized + core::marker::Unpin> Wrapper<T> {
282                            const IMPLS: bool = true;
283                        }
284                        <Wrapper<Self>>::IMPLS
285                    } {
286                        traits = traits.union(::facet_core::MarkerTraits::UNPIN);
287                    }
288                    builder = builder.marker_traits(traits);
289                }
290                if {
291                    /// Fallback trait with `False` for `IMPLS` if the type does not
292                    /// implement the given trait.
293                    trait DoesNotImpl {
294                        const IMPLS: bool = false;
295                    }
296                    impl<T: ?Sized> DoesNotImpl for T {}
297                    /// Concrete type with `True` for `IMPLS` if the type implements the
298                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
299                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
300                    #[allow(dead_code)]
301                    impl<T: ?Sized + core::cmp::PartialEq> Wrapper<T> {
302                        const IMPLS: bool = true;
303                    }
304                    <Wrapper<Self>>::IMPLS
305                } {
306                    builder = builder.eq(|left, right| {
307                        use ::facet_core::spez::*;
308                        (&&Spez(unsafe { left.get::<Self>() }))
309                            .spez_eq(&&Spez(unsafe { right.get::<Self>() }))
310                    });
311                }
312                if {
313                    /// Fallback trait with `False` for `IMPLS` if the type does not
314                    /// implement the given trait.
315                    trait DoesNotImpl {
316                        const IMPLS: bool = false;
317                    }
318                    impl<T: ?Sized> DoesNotImpl for T {}
319                    /// Concrete type with `True` for `IMPLS` if the type implements the
320                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
321                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
322                    #[allow(dead_code)]
323                    impl<T: ?Sized + core::cmp::PartialOrd> Wrapper<T> {
324                        const IMPLS: bool = true;
325                    }
326                    <Wrapper<Self>>::IMPLS
327                } {
328                    builder = builder.partial_ord(|left, right| {
329                        use ::facet_core::spez::*;
330                        (&&Spez(unsafe { left.get::<Self>() }))
331                            .spez_partial_cmp(&&Spez(unsafe { right.get::<Self>() }))
332                    });
333                }
334                if {
335                    /// Fallback trait with `False` for `IMPLS` if the type does not
336                    /// implement the given trait.
337                    trait DoesNotImpl {
338                        const IMPLS: bool = false;
339                    }
340                    impl<T: ?Sized> DoesNotImpl for T {}
341                    /// Concrete type with `True` for `IMPLS` if the type implements the
342                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
343                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
344                    #[allow(dead_code)]
345                    impl<T: ?Sized + core::cmp::Ord> Wrapper<T> {
346                        const IMPLS: bool = true;
347                    }
348                    <Wrapper<Self>>::IMPLS
349                } {
350                    builder = builder.ord(|left, right| {
351                        use ::facet_core::spez::*;
352                        (&&Spez(unsafe { left.get::<Self>() }))
353                            .spez_cmp(&&Spez(unsafe { right.get::<Self>() }))
354                    });
355                }
356                if {
357                    /// Fallback trait with `False` for `IMPLS` if the type does not
358                    /// implement the given trait.
359                    trait DoesNotImpl {
360                        const IMPLS: bool = false;
361                    }
362                    impl<T: ?Sized> DoesNotImpl for T {}
363                    /// Concrete type with `True` for `IMPLS` if the type implements the
364                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
365                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
366                    #[allow(dead_code)]
367                    impl<T: ?Sized + core::hash::Hash> Wrapper<T> {
368                        const IMPLS: bool = true;
369                    }
370                    <Wrapper<Self>>::IMPLS
371                } {
372                    builder = builder.hash(|value, hasher_this, hasher_write_fn| {
373                        use ::facet_core::HasherProxy;
374                        use ::facet_core::spez::*;
375                        (&&Spez(unsafe { value.get::<Self>() })).spez_hash(&mut unsafe {
376                            HasherProxy::new(hasher_this, hasher_write_fn)
377                        })
378                    });
379                }
380                if {
381                    /// Fallback trait with `False` for `IMPLS` if the type does not
382                    /// implement the given trait.
383                    trait DoesNotImpl {
384                        const IMPLS: bool = false;
385                    }
386                    impl<T: ?Sized> DoesNotImpl for T {}
387                    /// Concrete type with `True` for `IMPLS` if the type implements the
388                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
389                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
390                    #[allow(dead_code)]
391                    impl<T: ?Sized + core::str::FromStr> Wrapper<T> {
392                        const IMPLS: bool = true;
393                    }
394                    <Wrapper<Self>>::IMPLS
395                } {
396                    builder = builder.parse(|s, target| {
397                        use ::facet_core::spez::*;
398                        let res = unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_parse(s, target) };
399                        res.map(|_| unsafe { target.assume_init() })
400                    });
401                }
402                builder.build()
403            };
404            vtable
405        };
406        crate::Shape::builder()
407            .id(crate::ConstTypeId::of::<Self>())
408            .layout(::core::alloc::Layout::new::<Self>())
409            .vtable(vtable)
410            .def(crate::Def::Struct(
411                crate::Struct::builder()
412                    .kind(crate::StructKind::Struct)
413                    .fields(fields)
414                    .build(),
415            ))
416            .doc(&[" A struct demonstrating various field types and attributes."])
417            .build()
418    };
419}
420/// A simple point struct, also deriving Facet.
421pub struct Point {
422    pub x: f32,
423    pub y: f32,
424    /// Nested sensitive data within the struct.
425    pub metadata: String,
426}
427#[used]
428static POINT_SHAPE: &'static crate::Shape = <Point as crate::Facet>::SHAPE;
429#[automatically_derived]
430unsafe impl crate::Facet for Point {
431    const SHAPE: &'static crate::Shape = &const {
432        let fields: &'static [crate::Field] = &const {
433            [
434                crate::Field::builder()
435                    .name("x")
436                    .shape(|| crate::shape_of(&(|s: &Point| &s.x)))
437                    .offset({
438                        builtin # offset_of(Point<>, x)
439                    })
440                    .flags(crate::FieldFlags::EMPTY)
441                    .attributes(&[])
442                    .build(),
443                crate::Field::builder()
444                    .name("y")
445                    .shape(|| crate::shape_of(&(|s: &Point| &s.y)))
446                    .offset({
447                        builtin # offset_of(Point<>, y)
448                    })
449                    .flags(crate::FieldFlags::EMPTY)
450                    .attributes(&[])
451                    .build(),
452                crate::Field::builder()
453                    .name("metadata")
454                    .shape(|| crate::shape_of(&(|s: &Point| &s.metadata)))
455                    .offset({
456                        builtin # offset_of(Point<>, metadata)
457                    })
458                    .flags(crate::FieldFlags::SENSITIVE)
459                    .attributes(&[crate::FieldAttribute::Sensitive])
460                    .doc(&[" Nested sensitive data within the struct."])
461                    .build(),
462            ]
463        };
464        let vtable = &const {
465            let mut vtable = const {
466                let mut builder = ::facet_core::ValueVTable::builder()
467                    .type_name(|f, _opts| ::core::fmt::Write::write_str(f, "Point"))
468                    .drop_in_place(|data| unsafe { data.drop_in_place::<Self>() });
469                if {
470                    /// Fallback trait with `False` for `IMPLS` if the type does not
471                    /// implement the given trait.
472                    trait DoesNotImpl {
473                        const IMPLS: bool = false;
474                    }
475                    impl<T: ?Sized> DoesNotImpl for T {}
476                    /// Concrete type with `True` for `IMPLS` if the type implements the
477                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
478                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
479                    #[allow(dead_code)]
480                    impl<T: ?Sized + core::fmt::Display> Wrapper<T> {
481                        const IMPLS: bool = true;
482                    }
483                    <Wrapper<Self>>::IMPLS
484                } {
485                    builder = builder.display(|data, f| {
486                        use ::facet_core::spez::*;
487                        (&&Spez(unsafe { data.get::<Self>() })).spez_display(f)
488                    });
489                }
490                if {
491                    /// Fallback trait with `False` for `IMPLS` if the type does not
492                    /// implement the given trait.
493                    trait DoesNotImpl {
494                        const IMPLS: bool = false;
495                    }
496                    impl<T: ?Sized> DoesNotImpl for T {}
497                    /// Concrete type with `True` for `IMPLS` if the type implements the
498                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
499                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
500                    #[allow(dead_code)]
501                    impl<T: ?Sized + core::fmt::Debug> Wrapper<T> {
502                        const IMPLS: bool = true;
503                    }
504                    <Wrapper<Self>>::IMPLS
505                } {
506                    builder = builder.debug(|data, f| {
507                        use ::facet_core::spez::*;
508                        (&&Spez(unsafe { data.get::<Self>() })).spez_debug(f)
509                    });
510                }
511                if {
512                    /// Fallback trait with `False` for `IMPLS` if the type does not
513                    /// implement the given trait.
514                    trait DoesNotImpl {
515                        const IMPLS: bool = false;
516                    }
517                    impl<T: ?Sized> DoesNotImpl for T {}
518                    /// Concrete type with `True` for `IMPLS` if the type implements the
519                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
520                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
521                    #[allow(dead_code)]
522                    impl<T: ?Sized + core::default::Default> Wrapper<T> {
523                        const IMPLS: bool = true;
524                    }
525                    <Wrapper<Self>>::IMPLS
526                } {
527                    builder = builder.default_in_place(|target| {
528                        use ::facet_core::spez::*;
529                        unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_default_in_place(target) }
530                    });
531                }
532                if {
533                    /// Fallback trait with `False` for `IMPLS` if the type does not
534                    /// implement the given trait.
535                    trait DoesNotImpl {
536                        const IMPLS: bool = false;
537                    }
538                    impl<T: ?Sized> DoesNotImpl for T {}
539                    /// Concrete type with `True` for `IMPLS` if the type implements the
540                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
541                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
542                    #[allow(dead_code)]
543                    impl<T: ?Sized + core::clone::Clone> Wrapper<T> {
544                        const IMPLS: bool = true;
545                    }
546                    <Wrapper<Self>>::IMPLS
547                } {
548                    builder = builder.clone_into(|src, dst| {
549                        use ::facet_core::spez::*;
550                        unsafe { (&&Spez(src.get::<Self>())).spez_clone_into(dst) }
551                    });
552                }
553                {
554                    let mut traits = ::facet_core::MarkerTraits::empty();
555                    if {
556                        /// Fallback trait with `False` for `IMPLS` if the type does not
557                        /// implement the given trait.
558                        trait DoesNotImpl {
559                            const IMPLS: bool = false;
560                        }
561                        impl<T: ?Sized> DoesNotImpl for T {}
562                        /// Concrete type with `True` for `IMPLS` if the type implements the
563                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
564                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
565                        #[allow(dead_code)]
566                        impl<T: ?Sized + core::cmp::Eq> Wrapper<T> {
567                            const IMPLS: bool = true;
568                        }
569                        <Wrapper<Self>>::IMPLS
570                    } {
571                        traits = traits.union(::facet_core::MarkerTraits::EQ);
572                    }
573                    if {
574                        /// Fallback trait with `False` for `IMPLS` if the type does not
575                        /// implement the given trait.
576                        trait DoesNotImpl {
577                            const IMPLS: bool = false;
578                        }
579                        impl<T: ?Sized> DoesNotImpl for T {}
580                        /// Concrete type with `True` for `IMPLS` if the type implements the
581                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
582                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
583                        #[allow(dead_code)]
584                        impl<T: ?Sized + core::marker::Send> Wrapper<T> {
585                            const IMPLS: bool = true;
586                        }
587                        <Wrapper<Self>>::IMPLS
588                    } {
589                        traits = traits.union(::facet_core::MarkerTraits::SEND);
590                    }
591                    if {
592                        /// Fallback trait with `False` for `IMPLS` if the type does not
593                        /// implement the given trait.
594                        trait DoesNotImpl {
595                            const IMPLS: bool = false;
596                        }
597                        impl<T: ?Sized> DoesNotImpl for T {}
598                        /// Concrete type with `True` for `IMPLS` if the type implements the
599                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
600                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
601                        #[allow(dead_code)]
602                        impl<T: ?Sized + core::marker::Sync> Wrapper<T> {
603                            const IMPLS: bool = true;
604                        }
605                        <Wrapper<Self>>::IMPLS
606                    } {
607                        traits = traits.union(::facet_core::MarkerTraits::SYNC);
608                    }
609                    if {
610                        /// Fallback trait with `False` for `IMPLS` if the type does not
611                        /// implement the given trait.
612                        trait DoesNotImpl {
613                            const IMPLS: bool = false;
614                        }
615                        impl<T: ?Sized> DoesNotImpl for T {}
616                        /// Concrete type with `True` for `IMPLS` if the type implements the
617                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
618                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
619                        #[allow(dead_code)]
620                        impl<T: ?Sized + core::marker::Copy> Wrapper<T> {
621                            const IMPLS: bool = true;
622                        }
623                        <Wrapper<Self>>::IMPLS
624                    } {
625                        traits = traits.union(::facet_core::MarkerTraits::COPY);
626                    }
627                    if {
628                        /// Fallback trait with `False` for `IMPLS` if the type does not
629                        /// implement the given trait.
630                        trait DoesNotImpl {
631                            const IMPLS: bool = false;
632                        }
633                        impl<T: ?Sized> DoesNotImpl for T {}
634                        /// Concrete type with `True` for `IMPLS` if the type implements the
635                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
636                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
637                        #[allow(dead_code)]
638                        impl<T: ?Sized + core::marker::Unpin> Wrapper<T> {
639                            const IMPLS: bool = true;
640                        }
641                        <Wrapper<Self>>::IMPLS
642                    } {
643                        traits = traits.union(::facet_core::MarkerTraits::UNPIN);
644                    }
645                    builder = builder.marker_traits(traits);
646                }
647                if {
648                    /// Fallback trait with `False` for `IMPLS` if the type does not
649                    /// implement the given trait.
650                    trait DoesNotImpl {
651                        const IMPLS: bool = false;
652                    }
653                    impl<T: ?Sized> DoesNotImpl for T {}
654                    /// Concrete type with `True` for `IMPLS` if the type implements the
655                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
656                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
657                    #[allow(dead_code)]
658                    impl<T: ?Sized + core::cmp::PartialEq> Wrapper<T> {
659                        const IMPLS: bool = true;
660                    }
661                    <Wrapper<Self>>::IMPLS
662                } {
663                    builder = builder.eq(|left, right| {
664                        use ::facet_core::spez::*;
665                        (&&Spez(unsafe { left.get::<Self>() }))
666                            .spez_eq(&&Spez(unsafe { right.get::<Self>() }))
667                    });
668                }
669                if {
670                    /// Fallback trait with `False` for `IMPLS` if the type does not
671                    /// implement the given trait.
672                    trait DoesNotImpl {
673                        const IMPLS: bool = false;
674                    }
675                    impl<T: ?Sized> DoesNotImpl for T {}
676                    /// Concrete type with `True` for `IMPLS` if the type implements the
677                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
678                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
679                    #[allow(dead_code)]
680                    impl<T: ?Sized + core::cmp::PartialOrd> Wrapper<T> {
681                        const IMPLS: bool = true;
682                    }
683                    <Wrapper<Self>>::IMPLS
684                } {
685                    builder = builder.partial_ord(|left, right| {
686                        use ::facet_core::spez::*;
687                        (&&Spez(unsafe { left.get::<Self>() }))
688                            .spez_partial_cmp(&&Spez(unsafe { right.get::<Self>() }))
689                    });
690                }
691                if {
692                    /// Fallback trait with `False` for `IMPLS` if the type does not
693                    /// implement the given trait.
694                    trait DoesNotImpl {
695                        const IMPLS: bool = false;
696                    }
697                    impl<T: ?Sized> DoesNotImpl for T {}
698                    /// Concrete type with `True` for `IMPLS` if the type implements the
699                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
700                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
701                    #[allow(dead_code)]
702                    impl<T: ?Sized + core::cmp::Ord> Wrapper<T> {
703                        const IMPLS: bool = true;
704                    }
705                    <Wrapper<Self>>::IMPLS
706                } {
707                    builder = builder.ord(|left, right| {
708                        use ::facet_core::spez::*;
709                        (&&Spez(unsafe { left.get::<Self>() }))
710                            .spez_cmp(&&Spez(unsafe { right.get::<Self>() }))
711                    });
712                }
713                if {
714                    /// Fallback trait with `False` for `IMPLS` if the type does not
715                    /// implement the given trait.
716                    trait DoesNotImpl {
717                        const IMPLS: bool = false;
718                    }
719                    impl<T: ?Sized> DoesNotImpl for T {}
720                    /// Concrete type with `True` for `IMPLS` if the type implements the
721                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
722                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
723                    #[allow(dead_code)]
724                    impl<T: ?Sized + core::hash::Hash> Wrapper<T> {
725                        const IMPLS: bool = true;
726                    }
727                    <Wrapper<Self>>::IMPLS
728                } {
729                    builder = builder.hash(|value, hasher_this, hasher_write_fn| {
730                        use ::facet_core::HasherProxy;
731                        use ::facet_core::spez::*;
732                        (&&Spez(unsafe { value.get::<Self>() })).spez_hash(&mut unsafe {
733                            HasherProxy::new(hasher_this, hasher_write_fn)
734                        })
735                    });
736                }
737                if {
738                    /// Fallback trait with `False` for `IMPLS` if the type does not
739                    /// implement the given trait.
740                    trait DoesNotImpl {
741                        const IMPLS: bool = false;
742                    }
743                    impl<T: ?Sized> DoesNotImpl for T {}
744                    /// Concrete type with `True` for `IMPLS` if the type implements the
745                    /// given trait. Otherwise, it falls back to `DoesNotImpl`.
746                    struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
747                    #[allow(dead_code)]
748                    impl<T: ?Sized + core::str::FromStr> Wrapper<T> {
749                        const IMPLS: bool = true;
750                    }
751                    <Wrapper<Self>>::IMPLS
752                } {
753                    builder = builder.parse(|s, target| {
754                        use ::facet_core::spez::*;
755                        let res = unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_parse(s, target) };
756                        res.map(|_| unsafe { target.assume_init() })
757                    });
758                }
759                builder.build()
760            };
761            vtable
762        };
763        crate::Shape::builder()
764            .id(crate::ConstTypeId::of::<Self>())
765            .layout(::core::alloc::Layout::new::<Self>())
766            .vtable(vtable)
767            .def(crate::Def::Struct(
768                crate::Struct::builder()
769                    .kind(crate::StructKind::Struct)
770                    .fields(fields)
771                    .build(),
772            ))
773            .doc(&[" A simple point struct, also deriving Facet."])
774            .build()
775    };
776}
777/// An enum demonstrating different variant types and attributes.
778#[repr(u8)]
779pub enum KitchenSinkEnum {
780    /// A simple unit variant.
781    UnitVariant,
782
783    /// A tuple variant with a single element.
784    ///
785    /// The contained `String` represents an important message payload.
786    TupleVariantSimple(String),
787
788    /// A tuple variant with multiple elements.
789    ///
790    /// Contains important positional data:
791    /// - `_0` (i32): An identifier code.
792    /// - `_1` (i32): A sequence number.
793    /// - `_2` (i32): A status flag.
794    TupleVariantMulti(i32, i32, i32),
795
796    /// A struct variant with named fields.
797    StructVariant {
798        /// The width dimension, crucial for rendering.
799        width: f64,
800        /// The height dimension, also crucial for rendering.
801        height: f64,
802    },
803
804    /// A tuple variant marked entirely as sensitive.
805    SensitiveTupleVariant(Vec<u8>),
806
807    /// A struct variant containing a sensitive field.
808    StructVariantWithSensitiveField {
809        /// The main data payload, publicly accessible.
810        payload: Vec<u8>,
811        /// The sensitive checksum for integrity verification.
812        checksum: u32,
813    },
814
815    /// A variant marked as arbitrary, potentially skipped during processing.
816    ArbitraryVariant((f64, f64)),
817
818    /// A variant containing another enum that derives Facet.
819    ///
820    /// The nested `SubEnum` indicates a specific sub-state or option.
821    NestedEnumVariant(SubEnum),
822}
823#[used]
824static KITCHEN_SINK_ENUM_SHAPE: &'static crate::Shape = <KitchenSinkEnum as crate::Facet>::SHAPE;
825#[automatically_derived]
826unsafe impl crate::Facet for KitchenSinkEnum {
827    const SHAPE: &'static crate::Shape = &const {
828        #[repr(C)]
829        struct __ShadowKitchenSinkEnum_TupleVariantSimple {
830            _discriminant: u8,
831            _0: String,
832        }
833        #[repr(C)]
834        struct __ShadowKitchenSinkEnum_TupleVariantMulti {
835            _discriminant: u8,
836            _0: i32,
837            _1: i32,
838            _2: i32,
839        }
840        #[repr(C)]
841        struct __ShadowKitchenSinkEnum_StructVariant {
842            _discriminant: u8,
843            width: f64,
844            height: f64,
845        }
846        #[repr(C)]
847        struct __ShadowKitchenSinkEnum_SensitiveTupleVariant {
848            _discriminant: u8,
849            _0: Vec<u8>,
850        }
851        #[repr(C)]
852        struct __ShadowKitchenSinkEnum_StructVariantWithSensitiveField {
853            _discriminant: u8,
854            payload: Vec<u8>,
855            checksum: u32,
856        }
857        #[repr(C)]
858        struct __ShadowKitchenSinkEnum_ArbitraryVariant {
859            _discriminant: u8,
860            _0: (f64, f64),
861        }
862        #[repr(C)]
863        struct __ShadowKitchenSinkEnum_NestedEnumVariant {
864            _discriminant: u8,
865            _0: SubEnum,
866        }
867        let __facet_variants: &'static [crate::Variant] = &const {
868            [
869                crate::Variant::builder()
870                    .name("UnitVariant")
871                    .discriminant(0)
872                    .fields(crate::Struct::builder().unit().build())
873                    .doc(&[" A simple unit variant."])
874                    .build(),
875                {
876                    let fields: &'static [crate::Field] = &const {
877                        [crate::Field::builder()
878                            .name("_0")
879                            .shape(|| {
880                                crate::shape_of(
881                                    &(|s: &__ShadowKitchenSinkEnum_TupleVariantSimple| &s._0),
882                                )
883                            })
884                            .offset({
885                                builtin # offset_of(__ShadowKitchenSinkEnum_TupleVariantSimple<>,
886                                                                                                _0)
887                            })
888                            .flags(crate::FieldFlags::EMPTY)
889                            .attributes(&[])
890                            .build()]
891                    };
892                    crate::Variant::builder()
893                        .name("TupleVariantSimple")
894                        .discriminant(1)
895                        .fields(crate::Struct::builder().tuple().fields(fields).build())
896                        .doc(&[
897                            " A tuple variant with a single element.",
898                            "",
899                            " The contained `String` represents an important message payload.",
900                        ])
901                        .build()
902                },
903                {
904                    let fields: &'static [crate::Field] = &const {
905                        [
906                            crate::Field::builder()
907                                .name("_0")
908                                .shape(|| {
909                                    crate::shape_of(
910                                        &(|s: &__ShadowKitchenSinkEnum_TupleVariantMulti| &s._0),
911                                    )
912                                })
913                                .offset({
914                                    builtin # offset_of(__ShadowKitchenSinkEnum_TupleVariantMulti<>,
915                                                                                                _0)
916                                })
917                                .flags(crate::FieldFlags::EMPTY)
918                                .attributes(&[])
919                                .build(),
920                            crate::Field::builder()
921                                .name("_1")
922                                .shape(|| {
923                                    crate::shape_of(
924                                        &(|s: &__ShadowKitchenSinkEnum_TupleVariantMulti| &s._1),
925                                    )
926                                })
927                                .offset({
928                                    builtin # offset_of(__ShadowKitchenSinkEnum_TupleVariantMulti<>,
929                                                                                                _1)
930                                })
931                                .flags(crate::FieldFlags::EMPTY)
932                                .attributes(&[])
933                                .build(),
934                            crate::Field::builder()
935                                .name("_2")
936                                .shape(|| {
937                                    crate::shape_of(
938                                        &(|s: &__ShadowKitchenSinkEnum_TupleVariantMulti| &s._2),
939                                    )
940                                })
941                                .offset({
942                                    builtin # offset_of(__ShadowKitchenSinkEnum_TupleVariantMulti<>,
943                                                                                                _2)
944                                })
945                                .flags(crate::FieldFlags::EMPTY)
946                                .attributes(&[])
947                                .build(),
948                        ]
949                    };
950                    crate::Variant::builder()
951                        .name("TupleVariantMulti")
952                        .discriminant(2)
953                        .fields(crate::Struct::builder().tuple().fields(fields).build())
954                        .doc(&[
955                            " A tuple variant with multiple elements.",
956                            "",
957                            " Contains important positional data:",
958                            " - `_0` (i32): An identifier code.",
959                            " - `_1` (i32): A sequence number.",
960                            " - `_2` (i32): A status flag.",
961                        ])
962                        .build()
963                },
964                {
965                    let fields: &'static [crate::Field] = &const {
966                        [crate::Field::builder().name("width").shape(||
967                                                                                                    crate::shape_of(&(|s:
968                                                                                                                    &__ShadowKitchenSinkEnum_StructVariant<>|
969                                                                                                                &s.width))).offset({
970                                                                                                builtin # offset_of(__ShadowKitchenSinkEnum_StructVariant<>,
971                                                                                                    width)
972                                                                                            }).flags(crate::FieldFlags::EMPTY).attributes(&[]).doc(&[" The width dimension, crucial for rendering."]).build(),
973                                                                        crate::Field::builder().name("height").shape(||
974                                                                                                    crate::shape_of(&(|s:
975                                                                                                                    &__ShadowKitchenSinkEnum_StructVariant<>|
976                                                                                                                &s.height))).offset({
977                                                                                                builtin # offset_of(__ShadowKitchenSinkEnum_StructVariant<>,
978                                                                                                    height)
979                                                                                            }).flags(crate::FieldFlags::EMPTY).attributes(&[]).doc(&[" The height dimension, also crucial for rendering."]).build()]
980                    };
981                    crate::Variant::builder()
982                        .name("StructVariant")
983                        .discriminant(3)
984                        .fields(crate::Struct::builder().struct_().fields(fields).build())
985                        .doc(&[" A struct variant with named fields."])
986                        .build()
987                },
988                {
989                    let fields: &'static [crate::Field] = &const {
990                        [crate::Field::builder()
991                            .name("_0")
992                            .shape(|| {
993                                crate::shape_of(
994                                    &(|s: &__ShadowKitchenSinkEnum_SensitiveTupleVariant| &s._0),
995                                )
996                            })
997                            .offset({
998                                builtin # offset_of(__ShadowKitchenSinkEnum_SensitiveTupleVariant<>,
999                                                                                                _0)
1000                            })
1001                            .flags(crate::FieldFlags::EMPTY)
1002                            .attributes(&[])
1003                            .build()]
1004                    };
1005                    crate::Variant::builder()
1006                        .name("SensitiveTupleVariant")
1007                        .discriminant(4)
1008                        .fields(crate::Struct::builder().tuple().fields(fields).build())
1009                        .doc(&[" A tuple variant marked entirely as sensitive."])
1010                        .build()
1011                },
1012                {
1013                    let fields: &'static [crate::Field] = &const {
1014                        [crate::Field::builder().name("payload").shape(||
1015                                                                                                    crate::shape_of(&(|s:
1016                                                                                                                    &__ShadowKitchenSinkEnum_StructVariantWithSensitiveField<>|
1017                                                                                                                &s.payload))).offset({
1018                                                                                                builtin # offset_of(__ShadowKitchenSinkEnum_StructVariantWithSensitiveField<>,
1019                                                                                                    payload)
1020                                                                                            }).flags(crate::FieldFlags::EMPTY).attributes(&[]).doc(&[" The main data payload, publicly accessible."]).build(),
1021                                                                        crate::Field::builder().name("checksum").shape(||
1022                                                                                                    crate::shape_of(&(|s:
1023                                                                                                                    &__ShadowKitchenSinkEnum_StructVariantWithSensitiveField<>|
1024                                                                                                                &s.checksum))).offset({
1025                                                                                                builtin # offset_of(__ShadowKitchenSinkEnum_StructVariantWithSensitiveField<>,
1026                                                                                                    checksum)
1027                                                                                            }).flags(crate::FieldFlags::SENSITIVE).attributes(&[crate::FieldAttribute::Sensitive]).doc(&[" The sensitive checksum for integrity verification."]).build()]
1028                    };
1029                    crate::Variant::builder()
1030                        .name("StructVariantWithSensitiveField")
1031                        .discriminant(5)
1032                        .fields(crate::Struct::builder().struct_().fields(fields).build())
1033                        .doc(&[" A struct variant containing a sensitive field."])
1034                        .build()
1035                },
1036                {
1037                    let fields: &'static [crate::Field] = &const {
1038                        [crate::Field::builder()
1039                            .name("_0")
1040                            .shape(|| {
1041                                crate::shape_of(
1042                                    &(|s: &__ShadowKitchenSinkEnum_ArbitraryVariant| &s._0),
1043                                )
1044                            })
1045                            .offset({
1046                                builtin # offset_of(__ShadowKitchenSinkEnum_ArbitraryVariant<>,
1047                                                                                                _0)
1048                            })
1049                            .flags(crate::FieldFlags::EMPTY)
1050                            .attributes(&[])
1051                            .build()]
1052                    };
1053                    crate::Variant::builder().name("ArbitraryVariant").discriminant(6).fields(crate::Struct::builder().tuple().fields(fields).build()).doc(&[" A variant marked as arbitrary, potentially skipped during processing."]).build()
1054                },
1055                {
1056                    let fields: &'static [crate::Field] = &const {
1057                        [crate::Field::builder()
1058                            .name("_0")
1059                            .shape(|| {
1060                                crate::shape_of(
1061                                    &(|s: &__ShadowKitchenSinkEnum_NestedEnumVariant| &s._0),
1062                                )
1063                            })
1064                            .offset({
1065                                builtin # offset_of(__ShadowKitchenSinkEnum_NestedEnumVariant<>,
1066                                                                                                _0)
1067                            })
1068                            .flags(crate::FieldFlags::EMPTY)
1069                            .attributes(&[])
1070                            .build()]
1071                    };
1072                    crate::Variant::builder()
1073                        .name("NestedEnumVariant")
1074                        .discriminant(7)
1075                        .fields(crate::Struct::builder().tuple().fields(fields).build())
1076                        .doc(&[
1077                            " A variant containing another enum that derives Facet.",
1078                            "",
1079                            " The nested `SubEnum` indicates a specific sub-state or option.",
1080                        ])
1081                        .build()
1082                },
1083            ]
1084        };
1085        crate::Shape::builder()
1086            .id(crate::ConstTypeId::of::<Self>())
1087            .layout(::core::alloc::Layout::new::<Self>())
1088            .vtable(
1089                &const {
1090                    let mut builder = ::facet_core::ValueVTable::builder()
1091                        .type_name(|f, _opts| ::core::fmt::Write::write_str(f, "KitchenSinkEnum"))
1092                        .drop_in_place(|data| unsafe { data.drop_in_place::<Self>() });
1093                    if {
1094                        /// Fallback trait with `False` for `IMPLS` if the type does not
1095                        /// implement the given trait.
1096                        trait DoesNotImpl {
1097                            const IMPLS: bool = false;
1098                        }
1099                        impl<T: ?Sized> DoesNotImpl for T {}
1100                        /// Concrete type with `True` for `IMPLS` if the type implements the
1101                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1102                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1103                        #[allow(dead_code)]
1104                        impl<T: ?Sized + core::fmt::Display> Wrapper<T> {
1105                            const IMPLS: bool = true;
1106                        }
1107                        <Wrapper<Self>>::IMPLS
1108                    } {
1109                        builder = builder.display(|data, f| {
1110                            use ::facet_core::spez::*;
1111                            (&&Spez(unsafe { data.get::<Self>() })).spez_display(f)
1112                        });
1113                    }
1114                    if {
1115                        /// Fallback trait with `False` for `IMPLS` if the type does not
1116                        /// implement the given trait.
1117                        trait DoesNotImpl {
1118                            const IMPLS: bool = false;
1119                        }
1120                        impl<T: ?Sized> DoesNotImpl for T {}
1121                        /// Concrete type with `True` for `IMPLS` if the type implements the
1122                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1123                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1124                        #[allow(dead_code)]
1125                        impl<T: ?Sized + core::fmt::Debug> Wrapper<T> {
1126                            const IMPLS: bool = true;
1127                        }
1128                        <Wrapper<Self>>::IMPLS
1129                    } {
1130                        builder = builder.debug(|data, f| {
1131                            use ::facet_core::spez::*;
1132                            (&&Spez(unsafe { data.get::<Self>() })).spez_debug(f)
1133                        });
1134                    }
1135                    if {
1136                        /// Fallback trait with `False` for `IMPLS` if the type does not
1137                        /// implement the given trait.
1138                        trait DoesNotImpl {
1139                            const IMPLS: bool = false;
1140                        }
1141                        impl<T: ?Sized> DoesNotImpl for T {}
1142                        /// Concrete type with `True` for `IMPLS` if the type implements the
1143                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1144                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1145                        #[allow(dead_code)]
1146                        impl<T: ?Sized + core::default::Default> Wrapper<T> {
1147                            const IMPLS: bool = true;
1148                        }
1149                        <Wrapper<Self>>::IMPLS
1150                    } {
1151                        builder = builder.default_in_place(|target| {
1152                            use ::facet_core::spez::*;
1153                            unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_default_in_place(target) }
1154                        });
1155                    }
1156                    if {
1157                        /// Fallback trait with `False` for `IMPLS` if the type does not
1158                        /// implement the given trait.
1159                        trait DoesNotImpl {
1160                            const IMPLS: bool = false;
1161                        }
1162                        impl<T: ?Sized> DoesNotImpl for T {}
1163                        /// Concrete type with `True` for `IMPLS` if the type implements the
1164                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1165                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1166                        #[allow(dead_code)]
1167                        impl<T: ?Sized + core::clone::Clone> Wrapper<T> {
1168                            const IMPLS: bool = true;
1169                        }
1170                        <Wrapper<Self>>::IMPLS
1171                    } {
1172                        builder = builder.clone_into(|src, dst| {
1173                            use ::facet_core::spez::*;
1174                            unsafe { (&&Spez(src.get::<Self>())).spez_clone_into(dst) }
1175                        });
1176                    }
1177                    {
1178                        let mut traits = ::facet_core::MarkerTraits::empty();
1179                        if {
1180                            /// Fallback trait with `False` for `IMPLS` if the type does not
1181                            /// implement the given trait.
1182                            trait DoesNotImpl {
1183                                const IMPLS: bool = false;
1184                            }
1185                            impl<T: ?Sized> DoesNotImpl for T {}
1186                            /// Concrete type with `True` for `IMPLS` if the type implements the
1187                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1188                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1189                            #[allow(dead_code)]
1190                            impl<T: ?Sized + core::cmp::Eq> Wrapper<T> {
1191                                const IMPLS: bool = true;
1192                            }
1193                            <Wrapper<Self>>::IMPLS
1194                        } {
1195                            traits = traits.union(::facet_core::MarkerTraits::EQ);
1196                        }
1197                        if {
1198                            /// Fallback trait with `False` for `IMPLS` if the type does not
1199                            /// implement the given trait.
1200                            trait DoesNotImpl {
1201                                const IMPLS: bool = false;
1202                            }
1203                            impl<T: ?Sized> DoesNotImpl for T {}
1204                            /// Concrete type with `True` for `IMPLS` if the type implements the
1205                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1206                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1207                            #[allow(dead_code)]
1208                            impl<T: ?Sized + core::marker::Send> Wrapper<T> {
1209                                const IMPLS: bool = true;
1210                            }
1211                            <Wrapper<Self>>::IMPLS
1212                        } {
1213                            traits = traits.union(::facet_core::MarkerTraits::SEND);
1214                        }
1215                        if {
1216                            /// Fallback trait with `False` for `IMPLS` if the type does not
1217                            /// implement the given trait.
1218                            trait DoesNotImpl {
1219                                const IMPLS: bool = false;
1220                            }
1221                            impl<T: ?Sized> DoesNotImpl for T {}
1222                            /// Concrete type with `True` for `IMPLS` if the type implements the
1223                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1224                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1225                            #[allow(dead_code)]
1226                            impl<T: ?Sized + core::marker::Sync> Wrapper<T> {
1227                                const IMPLS: bool = true;
1228                            }
1229                            <Wrapper<Self>>::IMPLS
1230                        } {
1231                            traits = traits.union(::facet_core::MarkerTraits::SYNC);
1232                        }
1233                        if {
1234                            /// Fallback trait with `False` for `IMPLS` if the type does not
1235                            /// implement the given trait.
1236                            trait DoesNotImpl {
1237                                const IMPLS: bool = false;
1238                            }
1239                            impl<T: ?Sized> DoesNotImpl for T {}
1240                            /// Concrete type with `True` for `IMPLS` if the type implements the
1241                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1242                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1243                            #[allow(dead_code)]
1244                            impl<T: ?Sized + core::marker::Copy> Wrapper<T> {
1245                                const IMPLS: bool = true;
1246                            }
1247                            <Wrapper<Self>>::IMPLS
1248                        } {
1249                            traits = traits.union(::facet_core::MarkerTraits::COPY);
1250                        }
1251                        if {
1252                            /// Fallback trait with `False` for `IMPLS` if the type does not
1253                            /// implement the given trait.
1254                            trait DoesNotImpl {
1255                                const IMPLS: bool = false;
1256                            }
1257                            impl<T: ?Sized> DoesNotImpl for T {}
1258                            /// Concrete type with `True` for `IMPLS` if the type implements the
1259                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1260                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1261                            #[allow(dead_code)]
1262                            impl<T: ?Sized + core::marker::Unpin> Wrapper<T> {
1263                                const IMPLS: bool = true;
1264                            }
1265                            <Wrapper<Self>>::IMPLS
1266                        } {
1267                            traits = traits.union(::facet_core::MarkerTraits::UNPIN);
1268                        }
1269                        builder = builder.marker_traits(traits);
1270                    }
1271                    if {
1272                        /// Fallback trait with `False` for `IMPLS` if the type does not
1273                        /// implement the given trait.
1274                        trait DoesNotImpl {
1275                            const IMPLS: bool = false;
1276                        }
1277                        impl<T: ?Sized> DoesNotImpl for T {}
1278                        /// Concrete type with `True` for `IMPLS` if the type implements the
1279                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1280                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1281                        #[allow(dead_code)]
1282                        impl<T: ?Sized + core::cmp::PartialEq> Wrapper<T> {
1283                            const IMPLS: bool = true;
1284                        }
1285                        <Wrapper<Self>>::IMPLS
1286                    } {
1287                        builder = builder.eq(|left, right| {
1288                            use ::facet_core::spez::*;
1289                            (&&Spez(unsafe { left.get::<Self>() }))
1290                                .spez_eq(&&Spez(unsafe { right.get::<Self>() }))
1291                        });
1292                    }
1293                    if {
1294                        /// Fallback trait with `False` for `IMPLS` if the type does not
1295                        /// implement the given trait.
1296                        trait DoesNotImpl {
1297                            const IMPLS: bool = false;
1298                        }
1299                        impl<T: ?Sized> DoesNotImpl for T {}
1300                        /// Concrete type with `True` for `IMPLS` if the type implements the
1301                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1302                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1303                        #[allow(dead_code)]
1304                        impl<T: ?Sized + core::cmp::PartialOrd> Wrapper<T> {
1305                            const IMPLS: bool = true;
1306                        }
1307                        <Wrapper<Self>>::IMPLS
1308                    } {
1309                        builder = builder.partial_ord(|left, right| {
1310                            use ::facet_core::spez::*;
1311                            (&&Spez(unsafe { left.get::<Self>() }))
1312                                .spez_partial_cmp(&&Spez(unsafe { right.get::<Self>() }))
1313                        });
1314                    }
1315                    if {
1316                        /// Fallback trait with `False` for `IMPLS` if the type does not
1317                        /// implement the given trait.
1318                        trait DoesNotImpl {
1319                            const IMPLS: bool = false;
1320                        }
1321                        impl<T: ?Sized> DoesNotImpl for T {}
1322                        /// Concrete type with `True` for `IMPLS` if the type implements the
1323                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1324                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1325                        #[allow(dead_code)]
1326                        impl<T: ?Sized + core::cmp::Ord> Wrapper<T> {
1327                            const IMPLS: bool = true;
1328                        }
1329                        <Wrapper<Self>>::IMPLS
1330                    } {
1331                        builder = builder.ord(|left, right| {
1332                            use ::facet_core::spez::*;
1333                            (&&Spez(unsafe { left.get::<Self>() }))
1334                                .spez_cmp(&&Spez(unsafe { right.get::<Self>() }))
1335                        });
1336                    }
1337                    if {
1338                        /// Fallback trait with `False` for `IMPLS` if the type does not
1339                        /// implement the given trait.
1340                        trait DoesNotImpl {
1341                            const IMPLS: bool = false;
1342                        }
1343                        impl<T: ?Sized> DoesNotImpl for T {}
1344                        /// Concrete type with `True` for `IMPLS` if the type implements the
1345                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1346                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1347                        #[allow(dead_code)]
1348                        impl<T: ?Sized + core::hash::Hash> Wrapper<T> {
1349                            const IMPLS: bool = true;
1350                        }
1351                        <Wrapper<Self>>::IMPLS
1352                    } {
1353                        builder = builder.hash(|value, hasher_this, hasher_write_fn| {
1354                            use ::facet_core::HasherProxy;
1355                            use ::facet_core::spez::*;
1356                            (&&Spez(unsafe { value.get::<Self>() })).spez_hash(&mut unsafe {
1357                                HasherProxy::new(hasher_this, hasher_write_fn)
1358                            })
1359                        });
1360                    }
1361                    if {
1362                        /// Fallback trait with `False` for `IMPLS` if the type does not
1363                        /// implement the given trait.
1364                        trait DoesNotImpl {
1365                            const IMPLS: bool = false;
1366                        }
1367                        impl<T: ?Sized> DoesNotImpl for T {}
1368                        /// Concrete type with `True` for `IMPLS` if the type implements the
1369                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1370                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1371                        #[allow(dead_code)]
1372                        impl<T: ?Sized + core::str::FromStr> Wrapper<T> {
1373                            const IMPLS: bool = true;
1374                        }
1375                        <Wrapper<Self>>::IMPLS
1376                    } {
1377                        builder = builder.parse(|s, target| {
1378                            use ::facet_core::spez::*;
1379                            let res = unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_parse(s, target) };
1380                            res.map(|_| unsafe { target.assume_init() })
1381                        });
1382                    }
1383                    builder.build()
1384                },
1385            )
1386            .def(crate::Def::Enum(
1387                crate::EnumDef::builder()
1388                    .variants(__facet_variants)
1389                    .repr(crate::EnumRepr::U8)
1390                    .build(),
1391            ))
1392            .doc(&[" An enum demonstrating different variant types and attributes."])
1393            .build()
1394    };
1395}
1396/// A sub-enum used within `KitchenSinkEnum`.
1397#[repr(u8)]
1398pub enum SubEnum {
1399    /// Option A.
1400    OptionA,
1401
1402    /// Option B with data.
1403    OptionB(u8),
1404
1405    /// A sensitive option.
1406    SensitiveOption(u64),
1407
1408    /// An arbitrary option.
1409    ArbitraryOption(u8),
1410}
1411#[used]
1412static SUB_ENUM_SHAPE: &'static crate::Shape = <SubEnum as crate::Facet>::SHAPE;
1413#[automatically_derived]
1414unsafe impl crate::Facet for SubEnum {
1415    const SHAPE: &'static crate::Shape = &const {
1416        #[repr(C)]
1417        struct __ShadowSubEnum_OptionB {
1418            _discriminant: u8,
1419            _0: u8,
1420        }
1421        #[repr(C)]
1422        struct __ShadowSubEnum_SensitiveOption {
1423            _discriminant: u8,
1424            _0: u64,
1425        }
1426        #[repr(C)]
1427        struct __ShadowSubEnum_ArbitraryOption {
1428            _discriminant: u8,
1429            _0: u8,
1430        }
1431        let __facet_variants: &'static [crate::Variant] = &const {
1432            [
1433                crate::Variant::builder()
1434                    .name("OptionA")
1435                    .discriminant(0)
1436                    .fields(crate::Struct::builder().unit().build())
1437                    .doc(&[" Option A."])
1438                    .build(),
1439                {
1440                    let fields: &'static [crate::Field] = &const {
1441                        [crate::Field::builder()
1442                            .name("_0")
1443                            .shape(|| crate::shape_of(&(|s: &__ShadowSubEnum_OptionB| &s._0)))
1444                            .offset({
1445                                builtin # offset_of(__ShadowSubEnum_OptionB<>, _0)
1446                            })
1447                            .flags(crate::FieldFlags::EMPTY)
1448                            .attributes(&[])
1449                            .build()]
1450                    };
1451                    crate::Variant::builder()
1452                        .name("OptionB")
1453                        .discriminant(1)
1454                        .fields(crate::Struct::builder().tuple().fields(fields).build())
1455                        .doc(&[" Option B with data."])
1456                        .build()
1457                },
1458                {
1459                    let fields: &'static [crate::Field] = &const {
1460                        [crate::Field::builder()
1461                            .name("_0")
1462                            .shape(|| {
1463                                crate::shape_of(&(|s: &__ShadowSubEnum_SensitiveOption| &s._0))
1464                            })
1465                            .offset({
1466                                builtin # offset_of(__ShadowSubEnum_SensitiveOption<>, _0)
1467                            })
1468                            .flags(crate::FieldFlags::EMPTY)
1469                            .attributes(&[])
1470                            .build()]
1471                    };
1472                    crate::Variant::builder()
1473                        .name("SensitiveOption")
1474                        .discriminant(2)
1475                        .fields(crate::Struct::builder().tuple().fields(fields).build())
1476                        .doc(&[" A sensitive option."])
1477                        .build()
1478                },
1479                {
1480                    let fields: &'static [crate::Field] = &const {
1481                        [crate::Field::builder()
1482                            .name("_0")
1483                            .shape(|| {
1484                                crate::shape_of(&(|s: &__ShadowSubEnum_ArbitraryOption| &s._0))
1485                            })
1486                            .offset({
1487                                builtin # offset_of(__ShadowSubEnum_ArbitraryOption<>, _0)
1488                            })
1489                            .flags(crate::FieldFlags::EMPTY)
1490                            .attributes(&[])
1491                            .build()]
1492                    };
1493                    crate::Variant::builder()
1494                        .name("ArbitraryOption")
1495                        .discriminant(3)
1496                        .fields(crate::Struct::builder().tuple().fields(fields).build())
1497                        .doc(&[" An arbitrary option."])
1498                        .build()
1499                },
1500            ]
1501        };
1502        crate::Shape::builder()
1503            .id(crate::ConstTypeId::of::<Self>())
1504            .layout(::core::alloc::Layout::new::<Self>())
1505            .vtable(
1506                &const {
1507                    let mut builder = ::facet_core::ValueVTable::builder()
1508                        .type_name(|f, _opts| ::core::fmt::Write::write_str(f, "SubEnum"))
1509                        .drop_in_place(|data| unsafe { data.drop_in_place::<Self>() });
1510                    if {
1511                        /// Fallback trait with `False` for `IMPLS` if the type does not
1512                        /// implement the given trait.
1513                        trait DoesNotImpl {
1514                            const IMPLS: bool = false;
1515                        }
1516                        impl<T: ?Sized> DoesNotImpl for T {}
1517                        /// Concrete type with `True` for `IMPLS` if the type implements the
1518                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1519                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1520                        #[allow(dead_code)]
1521                        impl<T: ?Sized + core::fmt::Display> Wrapper<T> {
1522                            const IMPLS: bool = true;
1523                        }
1524                        <Wrapper<Self>>::IMPLS
1525                    } {
1526                        builder = builder.display(|data, f| {
1527                            use ::facet_core::spez::*;
1528                            (&&Spez(unsafe { data.get::<Self>() })).spez_display(f)
1529                        });
1530                    }
1531                    if {
1532                        /// Fallback trait with `False` for `IMPLS` if the type does not
1533                        /// implement the given trait.
1534                        trait DoesNotImpl {
1535                            const IMPLS: bool = false;
1536                        }
1537                        impl<T: ?Sized> DoesNotImpl for T {}
1538                        /// Concrete type with `True` for `IMPLS` if the type implements the
1539                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1540                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1541                        #[allow(dead_code)]
1542                        impl<T: ?Sized + core::fmt::Debug> Wrapper<T> {
1543                            const IMPLS: bool = true;
1544                        }
1545                        <Wrapper<Self>>::IMPLS
1546                    } {
1547                        builder = builder.debug(|data, f| {
1548                            use ::facet_core::spez::*;
1549                            (&&Spez(unsafe { data.get::<Self>() })).spez_debug(f)
1550                        });
1551                    }
1552                    if {
1553                        /// Fallback trait with `False` for `IMPLS` if the type does not
1554                        /// implement the given trait.
1555                        trait DoesNotImpl {
1556                            const IMPLS: bool = false;
1557                        }
1558                        impl<T: ?Sized> DoesNotImpl for T {}
1559                        /// Concrete type with `True` for `IMPLS` if the type implements the
1560                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1561                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1562                        #[allow(dead_code)]
1563                        impl<T: ?Sized + core::default::Default> Wrapper<T> {
1564                            const IMPLS: bool = true;
1565                        }
1566                        <Wrapper<Self>>::IMPLS
1567                    } {
1568                        builder = builder.default_in_place(|target| {
1569                            use ::facet_core::spez::*;
1570                            unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_default_in_place(target) }
1571                        });
1572                    }
1573                    if {
1574                        /// Fallback trait with `False` for `IMPLS` if the type does not
1575                        /// implement the given trait.
1576                        trait DoesNotImpl {
1577                            const IMPLS: bool = false;
1578                        }
1579                        impl<T: ?Sized> DoesNotImpl for T {}
1580                        /// Concrete type with `True` for `IMPLS` if the type implements the
1581                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1582                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1583                        #[allow(dead_code)]
1584                        impl<T: ?Sized + core::clone::Clone> Wrapper<T> {
1585                            const IMPLS: bool = true;
1586                        }
1587                        <Wrapper<Self>>::IMPLS
1588                    } {
1589                        builder = builder.clone_into(|src, dst| {
1590                            use ::facet_core::spez::*;
1591                            unsafe { (&&Spez(src.get::<Self>())).spez_clone_into(dst) }
1592                        });
1593                    }
1594                    {
1595                        let mut traits = ::facet_core::MarkerTraits::empty();
1596                        if {
1597                            /// Fallback trait with `False` for `IMPLS` if the type does not
1598                            /// implement the given trait.
1599                            trait DoesNotImpl {
1600                                const IMPLS: bool = false;
1601                            }
1602                            impl<T: ?Sized> DoesNotImpl for T {}
1603                            /// Concrete type with `True` for `IMPLS` if the type implements the
1604                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1605                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1606                            #[allow(dead_code)]
1607                            impl<T: ?Sized + core::cmp::Eq> Wrapper<T> {
1608                                const IMPLS: bool = true;
1609                            }
1610                            <Wrapper<Self>>::IMPLS
1611                        } {
1612                            traits = traits.union(::facet_core::MarkerTraits::EQ);
1613                        }
1614                        if {
1615                            /// Fallback trait with `False` for `IMPLS` if the type does not
1616                            /// implement the given trait.
1617                            trait DoesNotImpl {
1618                                const IMPLS: bool = false;
1619                            }
1620                            impl<T: ?Sized> DoesNotImpl for T {}
1621                            /// Concrete type with `True` for `IMPLS` if the type implements the
1622                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1623                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1624                            #[allow(dead_code)]
1625                            impl<T: ?Sized + core::marker::Send> Wrapper<T> {
1626                                const IMPLS: bool = true;
1627                            }
1628                            <Wrapper<Self>>::IMPLS
1629                        } {
1630                            traits = traits.union(::facet_core::MarkerTraits::SEND);
1631                        }
1632                        if {
1633                            /// Fallback trait with `False` for `IMPLS` if the type does not
1634                            /// implement the given trait.
1635                            trait DoesNotImpl {
1636                                const IMPLS: bool = false;
1637                            }
1638                            impl<T: ?Sized> DoesNotImpl for T {}
1639                            /// Concrete type with `True` for `IMPLS` if the type implements the
1640                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1641                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1642                            #[allow(dead_code)]
1643                            impl<T: ?Sized + core::marker::Sync> Wrapper<T> {
1644                                const IMPLS: bool = true;
1645                            }
1646                            <Wrapper<Self>>::IMPLS
1647                        } {
1648                            traits = traits.union(::facet_core::MarkerTraits::SYNC);
1649                        }
1650                        if {
1651                            /// Fallback trait with `False` for `IMPLS` if the type does not
1652                            /// implement the given trait.
1653                            trait DoesNotImpl {
1654                                const IMPLS: bool = false;
1655                            }
1656                            impl<T: ?Sized> DoesNotImpl for T {}
1657                            /// Concrete type with `True` for `IMPLS` if the type implements the
1658                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1659                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1660                            #[allow(dead_code)]
1661                            impl<T: ?Sized + core::marker::Copy> Wrapper<T> {
1662                                const IMPLS: bool = true;
1663                            }
1664                            <Wrapper<Self>>::IMPLS
1665                        } {
1666                            traits = traits.union(::facet_core::MarkerTraits::COPY);
1667                        }
1668                        if {
1669                            /// Fallback trait with `False` for `IMPLS` if the type does not
1670                            /// implement the given trait.
1671                            trait DoesNotImpl {
1672                                const IMPLS: bool = false;
1673                            }
1674                            impl<T: ?Sized> DoesNotImpl for T {}
1675                            /// Concrete type with `True` for `IMPLS` if the type implements the
1676                            /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1677                            struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1678                            #[allow(dead_code)]
1679                            impl<T: ?Sized + core::marker::Unpin> Wrapper<T> {
1680                                const IMPLS: bool = true;
1681                            }
1682                            <Wrapper<Self>>::IMPLS
1683                        } {
1684                            traits = traits.union(::facet_core::MarkerTraits::UNPIN);
1685                        }
1686                        builder = builder.marker_traits(traits);
1687                    }
1688                    if {
1689                        /// Fallback trait with `False` for `IMPLS` if the type does not
1690                        /// implement the given trait.
1691                        trait DoesNotImpl {
1692                            const IMPLS: bool = false;
1693                        }
1694                        impl<T: ?Sized> DoesNotImpl for T {}
1695                        /// Concrete type with `True` for `IMPLS` if the type implements the
1696                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1697                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1698                        #[allow(dead_code)]
1699                        impl<T: ?Sized + core::cmp::PartialEq> Wrapper<T> {
1700                            const IMPLS: bool = true;
1701                        }
1702                        <Wrapper<Self>>::IMPLS
1703                    } {
1704                        builder = builder.eq(|left, right| {
1705                            use ::facet_core::spez::*;
1706                            (&&Spez(unsafe { left.get::<Self>() }))
1707                                .spez_eq(&&Spez(unsafe { right.get::<Self>() }))
1708                        });
1709                    }
1710                    if {
1711                        /// Fallback trait with `False` for `IMPLS` if the type does not
1712                        /// implement the given trait.
1713                        trait DoesNotImpl {
1714                            const IMPLS: bool = false;
1715                        }
1716                        impl<T: ?Sized> DoesNotImpl for T {}
1717                        /// Concrete type with `True` for `IMPLS` if the type implements the
1718                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1719                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1720                        #[allow(dead_code)]
1721                        impl<T: ?Sized + core::cmp::PartialOrd> Wrapper<T> {
1722                            const IMPLS: bool = true;
1723                        }
1724                        <Wrapper<Self>>::IMPLS
1725                    } {
1726                        builder = builder.partial_ord(|left, right| {
1727                            use ::facet_core::spez::*;
1728                            (&&Spez(unsafe { left.get::<Self>() }))
1729                                .spez_partial_cmp(&&Spez(unsafe { right.get::<Self>() }))
1730                        });
1731                    }
1732                    if {
1733                        /// Fallback trait with `False` for `IMPLS` if the type does not
1734                        /// implement the given trait.
1735                        trait DoesNotImpl {
1736                            const IMPLS: bool = false;
1737                        }
1738                        impl<T: ?Sized> DoesNotImpl for T {}
1739                        /// Concrete type with `True` for `IMPLS` if the type implements the
1740                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1741                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1742                        #[allow(dead_code)]
1743                        impl<T: ?Sized + core::cmp::Ord> Wrapper<T> {
1744                            const IMPLS: bool = true;
1745                        }
1746                        <Wrapper<Self>>::IMPLS
1747                    } {
1748                        builder = builder.ord(|left, right| {
1749                            use ::facet_core::spez::*;
1750                            (&&Spez(unsafe { left.get::<Self>() }))
1751                                .spez_cmp(&&Spez(unsafe { right.get::<Self>() }))
1752                        });
1753                    }
1754                    if {
1755                        /// Fallback trait with `False` for `IMPLS` if the type does not
1756                        /// implement the given trait.
1757                        trait DoesNotImpl {
1758                            const IMPLS: bool = false;
1759                        }
1760                        impl<T: ?Sized> DoesNotImpl for T {}
1761                        /// Concrete type with `True` for `IMPLS` if the type implements the
1762                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1763                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1764                        #[allow(dead_code)]
1765                        impl<T: ?Sized + core::hash::Hash> Wrapper<T> {
1766                            const IMPLS: bool = true;
1767                        }
1768                        <Wrapper<Self>>::IMPLS
1769                    } {
1770                        builder = builder.hash(|value, hasher_this, hasher_write_fn| {
1771                            use ::facet_core::HasherProxy;
1772                            use ::facet_core::spez::*;
1773                            (&&Spez(unsafe { value.get::<Self>() })).spez_hash(&mut unsafe {
1774                                HasherProxy::new(hasher_this, hasher_write_fn)
1775                            })
1776                        });
1777                    }
1778                    if {
1779                        /// Fallback trait with `False` for `IMPLS` if the type does not
1780                        /// implement the given trait.
1781                        trait DoesNotImpl {
1782                            const IMPLS: bool = false;
1783                        }
1784                        impl<T: ?Sized> DoesNotImpl for T {}
1785                        /// Concrete type with `True` for `IMPLS` if the type implements the
1786                        /// given trait. Otherwise, it falls back to `DoesNotImpl`.
1787                        struct Wrapper<T: ?Sized>(::core::marker::PhantomData<T>);
1788                        #[allow(dead_code)]
1789                        impl<T: ?Sized + core::str::FromStr> Wrapper<T> {
1790                            const IMPLS: bool = true;
1791                        }
1792                        <Wrapper<Self>>::IMPLS
1793                    } {
1794                        builder = builder.parse(|s, target| {
1795                            use ::facet_core::spez::*;
1796                            let res = unsafe { (&&SpezEmpty::<Self>::SPEZ).spez_parse(s, target) };
1797                            res.map(|_| unsafe { target.assume_init() })
1798                        });
1799                    }
1800                    builder.build()
1801                },
1802            )
1803            .def(crate::Def::Enum(
1804                crate::EnumDef::builder()
1805                    .variants(__facet_variants)
1806                    .repr(crate::EnumRepr::U8)
1807                    .build(),
1808            ))
1809            .doc(&[" A sub-enum used within `KitchenSinkEnum`."])
1810            .build()
1811    };
1812}