add is_sized method on Abi and Layout, and use it
This commit is contained in:
parent
742d3f02c2
commit
c78021709a
21 changed files with 39 additions and 29 deletions
|
@ -1083,6 +1083,11 @@ impl Abi {
|
|||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_sized(&self) -> bool {
|
||||
!self.is_unsized()
|
||||
}
|
||||
|
||||
/// Returns `true` if this is a single signed integer scalar
|
||||
#[inline]
|
||||
pub fn is_signed(&self) -> bool {
|
||||
|
@ -1490,6 +1495,11 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
|
|||
self.abi.is_unsized()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_sized(&self) -> bool {
|
||||
self.abi.is_sized()
|
||||
}
|
||||
|
||||
/// Returns `true` if the type is a ZST and not unsized.
|
||||
pub fn is_zst(&self) -> bool {
|
||||
match self.abi {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue