about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-07-21 17:17:42 +0200
committerGitHub <noreply@github.com>2023-07-21 17:17:42 +0200
commit1aaf583fa46181052161028a51559f6eeaa0f868 (patch)
tree2794e14c5dbdf59371b8a9639c4b17b6452237fd
parent4a90553717ab9274b6faa19cccb47d7c427dbe92 (diff)
parent3e0389561b8e6145d42c9043e94ae61bc960fa2e (diff)
downloadrust-1aaf583fa46181052161028a51559f6eeaa0f868.tar.gz
rust-1aaf583fa46181052161028a51559f6eeaa0f868.zip
Rollup merge of #113914 - dvdhrm:pr/zstdup, r=cjgillot
rustc_target: drop duplicate code

Drop duplicate helper methods on `Layout`, which are already implemented on `LayoutS`. Note that `Layout` has a `Deref` implementation to `LayoutS`, so all accessors are automatically redirected.

The methods are identical and have been copied to `rustc_abi` in:

    commit 390a637e296ccfaac4c6abd1291b0523e8a8e00b
    Author: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
    Date:   Mon Nov 7 00:36:11 2022 +0330

        move things from rustc_target::abi to rustc_abi

This commit left behind the original implementation. Drop it now.

(originally moved by ``@HKalbasi)``
-rw-r--r--compiler/rustc_target/src/abi/mod.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs
index 589cd3cf96b..084c917cc31 100644
--- a/compiler/rustc_target/src/abi/mod.rs
+++ b/compiler/rustc_target/src/abi/mod.rs
@@ -140,24 +140,3 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
         offset
     }
 }
-
-impl<'a, Ty> TyAndLayout<'a, Ty> {
-    /// Returns `true` if the layout corresponds to an unsized type.
-    pub fn is_unsized(&self) -> bool {
-        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 {
-            Abi::Scalar(_) | Abi::ScalarPair(..) | Abi::Vector { .. } => false,
-            Abi::Uninhabited => self.size.bytes() == 0,
-            Abi::Aggregate { sized } => sized && self.size.bytes() == 0,
-        }
-    }
-}