File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,23 @@ The *`export_name` [attribute]* specifies the name of the symbol that will be ex
126126r [abi . export_name. syntax]
127127The `export_name ` attribute uses the [MetaNameValueStr ] syntax to specify the symbol name .
128128
129+ r [abi . export_name. allowed- positions ]
130+ The `export_name ` attribute may only be applied to :
131+
132+ - [Static items ][items . static ]
133+ - [Free functions ][items . fn ]
134+ - [Inherent associated functions ][items . associated. fn ]
135+ - [Trait impl functions ][items . impl . trait ]
136+
137+ > [! NOTE ]
138+ > `rustc ` currently ignores `export_name ` in some positions , but this may be rejected in the future .
139+
140+ r [abi . export_name. duplicates]
141+ Only the last instance of `export_name ` on an item is honored . Previous `export_name ` attributes are ignored .
142+
143+ > [! NOTE ]
144+ > `rustc ` currently warns on preceding duplicate `export_name ` attributes . This may become an error in the future .
145+
129146r [abi . export_name. unsafe ]
130147This attribute is unsafe as a symbol with a custom name may collide with another symbol with the same name (or with a well - known symbol ), leading to undefined behavior .
131148
You can’t perform that action at this time.
0 commit comments