/rust/registry/src/index.crates.io-6f17d22bba15001f/equator-0.4.2/src/structures.rs
Line | Count | Source (jump to first uncovered line) |
1 | | use crate::{ |
2 | | decompose, |
3 | | traits::{DynInfo, DynInfoType, Expr}, |
4 | | }; |
5 | | use core::fmt; |
6 | | |
7 | | pub struct DebugMessageImpl<'a, D: decompose::Recompose> { |
8 | | pub result: &'a D::Result, |
9 | | pub source: &'a D::Source, |
10 | | pub debug_lhs: &'a D::DebugLhs, |
11 | | pub debug_rhs: &'a D::DebugRhs, |
12 | | pub debug_cmp: D::DebugCmp, |
13 | | pub vtable: &'a D::VTable, |
14 | | } |
15 | | pub struct DebugMessage<'a, D: decompose::Recompose> { |
16 | | pub source: &'a WithSource<D::Source, &'static D::VTable>, |
17 | | pub debug_lhs: D::DebugLhs, |
18 | | pub debug_rhs: D::DebugRhs, |
19 | | pub debug_cmp: D::DebugCmp, |
20 | | pub message: fmt::Arguments<'a>, |
21 | | } |
22 | | impl<D: decompose::Recompose> fmt::Debug for DebugMessage<'_, D> { |
23 | 0 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
24 | 0 | D::debug_final(self, f) |
25 | 0 | } Unexecuted instantiation: <equator::structures::DebugMessage<equator::CmpExpr> as core::fmt::Debug>::fmt Unexecuted instantiation: <equator::structures::DebugMessage<bool> as core::fmt::Debug>::fmt Unexecuted instantiation: <equator::structures::DebugMessage<_> as core::fmt::Debug>::fmt |
26 | | } |
27 | | |
28 | | impl<D: decompose::Recompose> Copy for DebugMessage<'_, D> {} |
29 | | impl<D: decompose::Recompose> Clone for DebugMessage<'_, D> { |
30 | 0 | fn clone(&self) -> Self { |
31 | 0 | *self |
32 | 0 | } |
33 | | } |
34 | | |
35 | | #[derive(Copy, Clone)] |
36 | | pub struct WithSource<S, V> { |
37 | | pub source: S, |
38 | | pub file: &'static str, |
39 | | pub line: u32, |
40 | | pub col: u32, |
41 | | pub vtable: V, |
42 | | } |
43 | | |
44 | | #[derive(Copy, Clone)] |
45 | | pub struct Finalize<E> { |
46 | | pub inner: E, |
47 | | } |
48 | | |
49 | | impl<E: DynInfoType> DynInfoType for Finalize<E> { |
50 | | type VTable = E::VTable; |
51 | | const NULL_VTABLE: &'static Self::VTable = E::NULL_VTABLE; |
52 | | } |
53 | | |
54 | | impl<E: DynInfo> DynInfo for Finalize<E> { |
55 | | const VTABLE: &'static Self::VTable = E::VTABLE; |
56 | | } |
57 | | |
58 | | impl<E> Expr for &Finalize<E> { |
59 | | type Result = Result<(), ()>; |
60 | | type Marker = bool; |
61 | | |
62 | | #[inline(always)] |
63 | 0 | fn eval_expr(&self) -> bool { |
64 | 0 | core::unreachable!() |
65 | | } |
66 | | } |
67 | | |
68 | | impl<E: Expr> Expr for &&Finalize<E> { |
69 | | type Result = E::Result; |
70 | | type Marker = E::Marker; |
71 | | |
72 | | #[inline(always)] |
73 | 0 | fn eval_expr(&self) -> bool { |
74 | 0 | self.inner.eval_expr() |
75 | 0 | } Unexecuted instantiation: <&&equator::structures::Finalize<equator::expr::CmpExpr<&equator::spec::by_val::CmpByValWrapper<equator::spec::sized::CmpSizedWrapper<equator::spec::debug::CmpDebugWrapper<equator::Le>>>, &equator::spec::by_val::ByVal<equator::spec::sized::SizedWrapper<equator::spec::debug::DebugWrapper<usize>>>, &equator::spec::by_val::ByVal<equator::spec::sized::SizedWrapper<equator::spec::debug::DebugWrapper<usize>>>>> as equator::traits::Expr>::eval_expr Unexecuted instantiation: <&&equator::structures::Finalize<bool> as equator::traits::Expr>::eval_expr Unexecuted instantiation: <&&equator::structures::Finalize<_> as equator::traits::Expr>::eval_expr |
76 | | } |