Skip to content

Update export_name to use the attribute template#1902

Open
ehuss wants to merge 11 commits intorust-lang:masterfrom
ehuss:export_name
Open

Update export_name to use the attribute template#1902
ehuss wants to merge 11 commits intorust-lang:masterfrom
ehuss:export_name

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Jun 30, 2025

New rules:

  • abi.export_name.allowed-positions
  • abi.export_name.duplicates
  • abi.export_name.no_mangle
  • abi.export_name.publicly-exported
  • abi.export_name.null
  • abi.export_name.generic

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
Specifies the interaction with export_name and no_mangle. This is
essentially a duplicate of abi.no_mangle.export_name, but I think it is
worthwile to say it in both places.
I'm not sure why this wasn't added before with no_mangle.
I believe this is done here:
https://github.com/rust-lang/rust/blob/HEAD/compiler/rustc_passes/src/dead.rs#L690-L700
More closely align with the template, and some minor word tweaks.
> `rustc` currently ignores `export_name` in some positions, but this may be rejected in the future.

r[abi.export_name.duplicates]
Only the last use of `export_name` on an item has effect.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed by rust-lang/rust#153041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: The marked PR is awaiting review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants