about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_error_messages/locales/en-US/passes.ftl4
-rw-r--r--compiler/rustc_passes/src/check_attr.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_error_messages/locales/en-US/passes.ftl b/compiler/rustc_error_messages/locales/en-US/passes.ftl
index 2802a0d2c64..d8056c77f0f 100644
--- a/compiler/rustc_error_messages/locales/en-US/passes.ftl
+++ b/compiler/rustc_error_messages/locales/en-US/passes.ftl
@@ -263,5 +263,5 @@ passes-rustc-lint-opt-ty = `#[rustc_lint_opt_ty]` should be applied to a struct
 passes-rustc-lint-opt-deny-field-access = `#[rustc_lint_opt_deny_field_access]` should be applied to a field
     .label = not a field
 
-passes-link-ordinal = attribute should be applied to a foreign function
-    .label = not a foreign function
\ No newline at end of file
+passes-link-ordinal = attribute should be applied to a foreign function or static
+    .label = not a foreign function or static
\ No newline at end of file
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index 9fee28a4035..8a8d88d7bf4 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -1864,7 +1864,7 @@ impl CheckAttrVisitor<'_> {
 
     fn check_link_ordinal(&self, attr: &Attribute, _span: Span, target: Target) -> bool {
         match target {
-            Target::ForeignFn => true,
+            Target::ForeignFn | Target::ForeignStatic => true,
             _ => {
                 self.tcx.sess.emit_err(errors::LinkOrdinal { attr_span: attr.span });
                 false