about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/middle
diff options
context:
space:
mode:
authorJubilee <46493976+workingjubilee@users.noreply.github.com>2021-10-07 20:26:11 -0700
committerGitHub <noreply@github.com>2021-10-07 20:26:11 -0700
commit6c17601a2e6fa55e5d2ec7284359bee931c0c61a (patch)
treecb4a16d19fd744ee5bf6bd608b59b5b1c822044b /compiler/rustc_middle/src/middle
parent2b6d7f75f7f5ac0bce2265b0e33256356441ccba (diff)
parent142f6c0b078ceef1dc817c418f628d350551f6e4 (diff)
downloadrust-6c17601a2e6fa55e5d2ec7284359bee931c0c61a.tar.gz
rust-6c17601a2e6fa55e5d2ec7284359bee931c0c61a.zip
Rollup merge of #89025 - ricobbe:raw-dylib-link-ordinal, r=michaelwoerister
Implement `#[link_ordinal(n)]`

Allows the use of `#[link_ordinal(n)]` with `#[link(kind = "raw-dylib")]`, allowing Rust to link against DLLs that export symbols by ordinal rather than by name.  As long as the ordinal matches, the name of the function in Rust is not required to match the name of the corresponding function in the exporting DLL.

Part of #58713.
Diffstat (limited to 'compiler/rustc_middle/src/middle')
-rw-r--r--compiler/rustc_middle/src/middle/codegen_fn_attrs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
index b2705c76939..b054d21adaa 100644
--- a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
+++ b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
@@ -22,7 +22,7 @@ pub struct CodegenFnAttrs {
     /// imported function has in the dynamic library. Note that this must not
     /// be set when `link_name` is set. This is for foreign items with the
     /// "raw-dylib" kind.
-    pub link_ordinal: Option<usize>,
+    pub link_ordinal: Option<u16>,
     /// The `#[target_feature(enable = "...")]` attribute and the enabled
     /// features (only enabled features are supported right now).
     pub target_features: Vec<Symbol>,