]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/cast.rs
Auto merge of #98961 - zeevm:issue-98958-fix, r=oli-obk
[rust.git] / compiler / rustc_middle / src / ty / cast.rs
index 20a6af5f6c13bb0d4207e2ad8f188e1829f8d18d..c4b743dd46701e11601ccc8991b8b54dae07401d 100644 (file)
@@ -15,6 +15,12 @@ pub enum IntTy {
     Char,
 }
 
+impl IntTy {
+    pub fn is_signed(self) -> bool {
+        matches!(self, Self::I)
+    }
+}
+
 // Valid types for the result of a non-coercion cast
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 pub enum CastTy<'tcx> {