Skip to content

Update no_mangle to use the attribute template - #1904

Open
ehuss wants to merge 9 commits into
rust-lang:masterfrom
ehuss:no_mangle
Open

Update no_mangle to use the attribute template#1904
ehuss wants to merge 9 commits into
rust-lang:masterfrom
ehuss:no_mangle

Conversation

@ehuss

@ehuss ehuss commented Jun 30, 2025

Copy link
Copy Markdown
Contributor

New rules:

  • abi.no_mangle.syntax
  • abi.no_mangle.allowed-positions
  • abi.no_mangle.duplicates
  • abi.no_mangle.export_name
  • abi.no_mangle.ascii-only
  • abi.no_mangle.generic

@rustbot rustbot added the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Jun 30, 2025
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@oli-obk

oli-obk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Can we land this? it's blocking rust-lang/rust#154585

Comment thread src/abi.md Outdated
`no_mangle` may only be used on items with a name that only contains ASCII characters.

r[abi.no_mangle.generic]
`no_mangle` has no effect on generic items.

@RalfJung RalfJung Jul 29, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With rust-lang/rust#154585, no_mangle is forbidden on generic items.

View changes since the review

ehuss added 9 commits July 29, 2026 06:48
This moves it below to match the template of having behavioral rules
after the syntax.
This is to match the template order.
It doesn't really work with any item, it is functions and statics.
This specifies the conflict between no_mangle and export_name.
This is a restriction that wasn't previously documented.
@rustbot

rustbot commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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.

4 participants