]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_session/src/utils.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / compiler / rustc_session / src / utils.rs
index 9a4f6f9f9ef0cc3a2c04abdc7faf192335eed493..e65b6891e3221077fe6a50de79c7a37a91b90ee9 100644 (file)
@@ -53,6 +53,17 @@ impl NativeLibKind {
             NativeLibKind::RawDylib | NativeLibKind::Unspecified | NativeLibKind::LinkArg => false,
         }
     }
+
+    pub fn is_statically_included(&self) -> bool {
+        matches!(self, NativeLibKind::Static { .. })
+    }
+
+    pub fn is_dllimport(&self) -> bool {
+        matches!(
+            self,
+            NativeLibKind::Dylib { .. } | NativeLibKind::RawDylib | NativeLibKind::Unspecified
+        )
+    }
 }
 
 #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable, Decodable)]