File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
library/core/src/os/darwin Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ pub type SEL = *mut objc_selector;
7272/// ```
7373#[ allow_internal_unstable( rustc_attrs) ]
7474pub macro class ( $classname: expr) { {
75+ // Since static Objective-C class references actually end up with multiple definitions
76+ // across dylib boundaries, we only expose the value of the static and don't provide a way to
77+ // get the address of or a reference to the static.
7578 unsafe extern "C" {
7679 #[ rustc_objc_class = $classname]
7780 safe static VAL : $crate:: os:: darwin:: objc:: Class ;
@@ -93,6 +96,9 @@ pub macro class($classname:expr) {{
9396/// ```
9497#[ allow_internal_unstable( rustc_attrs) ]
9598pub macro selector ( $methname: expr) { {
99+ // Since static Objective-C selector references actually end up with multiple definitions
100+ // across dylib boundaries, we only expose the value of the static and don't provide a way to
101+ // get the address of or a reference to the static.
96102 unsafe extern "C" {
97103 #[ rustc_objc_selector = $methname]
98104 safe static VAL : $crate:: os:: darwin:: objc:: SEL ;
You can’t perform that action at this time.
0 commit comments