diff options
| author | Luqman Aden <me@luqman.ca> | 2021-03-24 21:45:09 -0700 |
|---|---|---|
| committer | Luqman Aden <me@luqman.ca> | 2021-05-05 16:04:25 -0700 |
| commit | db555e1284dd37f4f3c76474aabfca09140a7ab3 (patch) | |
| tree | 6e6e96a1c43ac0c193e3ab756bcfe8d4747c904c /compiler/rustc_metadata/src/rmeta/decoder | |
| parent | bacf770f2983a52f31e3537db5f0fe1ef2eaa874 (diff) | |
| download | rust-db555e1284dd37f4f3c76474aabfca09140a7ab3.tar.gz rust-db555e1284dd37f4f3c76474aabfca09140a7ab3.zip | |
Implement RFC 2951: Native link modifiers
This commit implements both the native linking modifiers infrastructure as well as an initial attempt at the individual modifiers from the RFC. It also introduces a feature flag for the general syntax along with individual feature flags for each modifier.
Diffstat (limited to 'compiler/rustc_metadata/src/rmeta/decoder')
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 8595a70dd94..b11ad6c7ff8 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -256,16 +256,13 @@ pub fn provide(providers: &mut Providers) { // resolve! Does this work? Unsure! That's what the issue is about *providers = Providers { is_dllimport_foreign_item: |tcx, id| match tcx.native_library_kind(id) { - Some(NativeLibKind::Dylib | NativeLibKind::RawDylib | NativeLibKind::Unspecified) => { - true - } + Some( + NativeLibKind::Dylib { .. } | NativeLibKind::RawDylib | NativeLibKind::Unspecified, + ) => true, _ => false, }, is_statically_included_foreign_item: |tcx, id| { - matches!( - tcx.native_library_kind(id), - Some(NativeLibKind::StaticBundle | NativeLibKind::StaticNoBundle) - ) + matches!(tcx.native_library_kind(id), Some(NativeLibKind::Static { .. })) }, native_library_kind: |tcx, id| { tcx.native_libraries(id.krate) |
