]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs
Rollup merge of #105983 - compiler-errors:issue-105981, r=tmiasko
[rust.git] / src / test / ui / rfc-2627-raw-dylib / link-ordinal-not-foreign-fn.rs
1 #![cfg_attr(target_arch = "x86", feature(raw_dylib))]
2
3 #[link_ordinal(123)]
4 //~^ ERROR attribute should be applied to a foreign function or static
5 struct Foo {}
6
7 #[link_ordinal(123)]
8 //~^ ERROR attribute should be applied to a foreign function or static
9 fn test() {}
10
11 #[link_ordinal(42)]
12 //~^ ERROR attribute should be applied to a foreign function or static
13 static mut imported_val: i32 = 123;
14
15 #[link(name = "exporter", kind = "raw-dylib")]
16 extern {
17     #[link_ordinal(13)]
18     fn imported_function();
19
20     #[link_ordinal(42)]
21     static mut imported_variable: i32;
22 }
23
24 fn main() {}