-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase_type_wit.rs
62 lines (45 loc) · 1.66 KB
/
base_type_wit.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! abstractions over
//! [`TypeEq`](crate::TypeEq)/[`TypeNe`](crate::TypeNe)/[`TypeCmp`](crate::TypeCmp).
mod meta_base_type_wit;
pub use meta_base_type_wit::MetaBaseTypeWit;
/// Marker trait for
/// [`TypeCmp`](crate::TypeCmp)/[`TypeEq`](crate::TypeEq)/[`TypeNe`](crate::TypeNe).
///
/// [`TypeEq`]: crate::TypeEq
/// [`TypeNe`]: crate::TypeNe
/// [`TypeCmp`]: crate::TypeCmp
#[cfg_attr(feature = "docsrs", doc(cfg(feature = "rust_1_61")))]
pub trait BaseTypeWitness:
core::fmt::Debug +
Copy +
crate::HasTypeWitness<MetaBaseTypeWit<Self::L, Self::R, Self>>
{
/// The `L` type parameter of `TypeEq`/`TypeNe`/`TypeCmp` types.
type L: ?Sized;
/// The `R` type parameter of `TypeEq`/`TypeNe`/`TypeCmp` types.
type R: ?Sized;
/// The [type constructor] corresponding to this type.
///
/// [type constructor]: crate::type_constructors::BaseTypeWitnessTc
#[cfg(feature = "rust_1_65")]
#[cfg_attr(feature = "docsrs", doc(cfg(feature = "rust_1_65")))]
type TypeCtor: crate::type_constructors::BaseTypeWitnessTc<Type<Self::L, Self::R> = Self>;
}
impl<L: ?Sized, R: ?Sized> BaseTypeWitness for crate::TypeEq<L, R> {
type L = L;
type R = R;
#[cfg(feature = "rust_1_65")]
type TypeCtor = crate::type_constructors::TcTypeEq;
}
impl<L: ?Sized, R: ?Sized> BaseTypeWitness for crate::TypeNe<L, R> {
type L = L;
type R = R;
#[cfg(feature = "rust_1_65")]
type TypeCtor = crate::type_constructors::TcTypeNe;
}
impl<L: ?Sized, R: ?Sized> BaseTypeWitness for crate::TypeCmp<L, R> {
type L = L;
type R = R;
#[cfg(feature = "rust_1_65")]
type TypeCtor = crate::type_constructors::TcTypeCmp;
}