Lines Matching defs:F
71 /// If an instance for `FormatAdapter<_, F>` is constructed, `F` is inhabited.
73 pub(crate) struct FormatAdapter<D, F> {
75 _formatter: PhantomData<F>,
78 impl<D, F> Deref for FormatAdapter<D, F> {
85 impl<D, F> Writer for FormatAdapter<D, F>
87 F: Fn(&D, &mut fmt::Formatter<'_>) -> fmt::Result + 'static,
90 // SAFETY: FormatAdapter<_, F> can only be constructed if F is inhabited
91 let f: &F = unsafe { materialize_zst() };
97 unsafe impl<D, F> Adapter for FormatAdapter<D, F> {
122 /// The caller asserts that F is inhabited
123 unsafe fn materialize_zst<F>() -> &'static F {
124 const { assert!(core::mem::size_of::<F>() == 0) };
125 let zst_dangle: core::ptr::NonNull<F> = core::ptr::NonNull::dangling();