diff options
Diffstat (limited to 'compiler/rustc_session/src/utils.rs')
| -rw-r--r-- | compiler/rustc_session/src/utils.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/rustc_session/src/utils.rs b/compiler/rustc_session/src/utils.rs index a33f94013d2..6a8775bd10b 100644 --- a/compiler/rustc_session/src/utils.rs +++ b/compiler/rustc_session/src/utils.rs @@ -43,6 +43,20 @@ pub enum NativeLibKind { Unspecified, } +impl NativeLibKind { + pub fn has_modifiers(&self) -> bool { + match self { + NativeLibKind::Static { bundle, whole_archive } => { + bundle.is_some() || whole_archive.is_some() + } + NativeLibKind::Dylib { as_needed } | NativeLibKind::Framework { as_needed } => { + as_needed.is_some() + } + NativeLibKind::RawDylib | NativeLibKind::Unspecified => false, + } + } +} + rustc_data_structures::impl_stable_hash_via_hash!(NativeLibKind); #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Encodable, Decodable)] @@ -53,6 +67,12 @@ pub struct NativeLib { pub verbatim: Option<bool>, } +impl NativeLib { + pub fn has_modifiers(&self) -> bool { + self.verbatim.is_some() || self.kind.has_modifiers() + } +} + rustc_data_structures::impl_stable_hash_via_hash!(NativeLib); /// A path that has been canonicalized along with its original, non-canonicalized form |
