forked from libre-chip/fayalite
add FillInDefaultedGenerics<Type = Self> bound for SizeType
This commit is contained in:
parent
e4210a672f
commit
fbe4585578
1 changed files with 9 additions and 3 deletions
|
|
@ -14,8 +14,9 @@ use crate::{
|
||||||
sim::value::{SimValue, ToSimValueWithType},
|
sim::value::{SimValue, ToSimValueWithType},
|
||||||
source_location::SourceLocation,
|
source_location::SourceLocation,
|
||||||
ty::{
|
ty::{
|
||||||
CanonicalType, OpaqueSimValueSize, OpaqueSimValueSlice, OpaqueSimValueWriter,
|
CanonicalType, FillInDefaultedGenerics, OpaqueSimValueSize, OpaqueSimValueSlice,
|
||||||
OpaqueSimValueWritten, StaticType, Type, TypeProperties, impl_match_variant_as_self,
|
OpaqueSimValueWriter, OpaqueSimValueWritten, StaticType, Type, TypeProperties,
|
||||||
|
impl_match_variant_as_self,
|
||||||
},
|
},
|
||||||
util::{ConstBool, ConstUsize, GenericConstBool, GenericConstUsize, interned_bit, slice_range},
|
util::{ConstBool, ConstUsize, GenericConstBool, GenericConstUsize, interned_bit, slice_range},
|
||||||
};
|
};
|
||||||
|
|
@ -113,7 +114,11 @@ impl_known_size_base! {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait KnownSize:
|
pub trait KnownSize:
|
||||||
GenericConstUsize + sealed::SizeTypeSealed + sealed::SizeSealed + Default
|
GenericConstUsize
|
||||||
|
+ sealed::SizeTypeSealed
|
||||||
|
+ sealed::SizeSealed
|
||||||
|
+ Default
|
||||||
|
+ FillInDefaultedGenerics<Type = Self>
|
||||||
{
|
{
|
||||||
const SIZE: Self;
|
const SIZE: Self;
|
||||||
type ArrayMatch<Element: Type>: AsRef<[Expr<Element>]>
|
type ArrayMatch<Element: Type>: AsRef<[Expr<Element>]>
|
||||||
|
|
@ -161,6 +166,7 @@ pub trait SizeType:
|
||||||
+ 'static
|
+ 'static
|
||||||
+ Serialize
|
+ Serialize
|
||||||
+ DeserializeOwned
|
+ DeserializeOwned
|
||||||
|
+ FillInDefaultedGenerics<Type = Self>
|
||||||
{
|
{
|
||||||
type Size: Size<SizeType = Self>;
|
type Size: Size<SizeType = Self>;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue