diff options
| author | Ralf Jung <post@ralfj.de> | 2022-11-13 12:14:59 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-11-13 12:23:53 +0100 |
| commit | c78021709a3e0265e6ac3c82fe50c1d4fc67467f (patch) | |
| tree | b114d56d6eb0224b7e976bc5dcc6ec4468b1c926 /compiler/rustc_target/src | |
| parent | 742d3f02c243964e5b868d90afd60c2907be5853 (diff) | |
| download | rust-c78021709a3e0265e6ac3c82fe50c1d4fc67467f.tar.gz rust-c78021709a3e0265e6ac3c82fe50c1d4fc67467f.zip | |
add is_sized method on Abi and Layout, and use it
Diffstat (limited to 'compiler/rustc_target/src')
| -rw-r--r-- | compiler/rustc_target/src/abi/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs index 7171ca7bf89..decbefc2f7c 100644 --- a/compiler/rustc_target/src/abi/mod.rs +++ b/compiler/rustc_target/src/abi/mod.rs @@ -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 { |
