We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[used]
1 parent 54133cf commit 16c2b39Copy full SHA for 16c2b39
src/test/run-make-fulldeps/used-cdylib-macos/Makefile
@@ -0,0 +1,11 @@
1
+-include ../tools.mk
2
+
3
+# only-macos
4
+#
5
+# This checks that `#[used]` passes through to the linker on
6
+# darwin. This is subject to change in the future, see
7
+# https://github.com/rust-lang/rust/pull/93718 for discussion
8
9
+all:
10
+ $(RUSTC) -Copt-level=3 dylib_used.rs
11
+ nm $(TMPDIR)/libdylib_used.dylib | $(CGREP) VERY_IMPORTANT_SYMBOL
src/test/run-make-fulldeps/used-cdylib-macos/dylib_used.rs
@@ -0,0 +1,4 @@
+#![crate_type = "cdylib"]
+#[used]
+static VERY_IMPORTANT_SYMBOL: u32 = 12345;
0 commit comments