Skip to content

Update no_mangle to use the attribute template - #1904

Merged
traviscross merged 10 commits into
rust-lang:masterfrom
ehuss:no_mangle
Aug 6, 2026
Merged

Update no_mangle to use the attribute template#1904
traviscross merged 10 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

@rustbot

This comment has been minimized.

@traviscross traviscross removed the S-waiting-on-review Status: The marked PR is awaiting review from a maintainer label Aug 5, 2026
@traviscross
traviscross added this pull request to the merge queue Aug 5, 2026
@traviscross
traviscross removed this pull request from the merge queue due to a manual request Aug 5, 2026
@traviscross
traviscross enabled auto-merge August 5, 2026 11:30
@traviscross
traviscross disabled auto-merge August 5, 2026 11:31
@traviscross traviscross added the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Aug 5, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 5, 2026
…items, r=oli-obk

treat no_mangle_generic_items as hard error instead of lint warning

Reference PR:

- rust-lang/reference#1904

In rust-lang/miri#4929 (comment), rustc should reject the no_mangled generic function.
This PR treat is as a hard error
rust-timer added a commit to rust-lang/rust that referenced this pull request Aug 6, 2026
Rollup merge of #154585 - HerrCai0907:fix/no_mangle_generic_items, r=oli-obk

treat no_mangle_generic_items as hard error instead of lint warning

Reference PR:

- rust-lang/reference#1904

In rust-lang/miri#4929 (comment), rustc should reject the no_mangled generic function.
This PR treat is as a hard error
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Aug 6, 2026
…oli-obk

treat no_mangle_generic_items as hard error instead of lint warning

Reference PR:

- rust-lang/reference#1904

In rust-lang/miri#4929 (comment), rustc should reject the no_mangled generic function.
This PR treat is as a hard error
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Aug 6, 2026
…oli-obk

treat no_mangle_generic_items as hard error instead of lint warning

Reference PR:

- rust-lang/reference#1904

In rust-lang#4929 (comment), rustc should reject the no_mangled generic function.
This PR treat is as a hard error
@oli-obk

oli-obk commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

the stabilization PR has landed (unsure if you want cross-repo messages like this, the reference dev guide didn't have anything about procedures in the stabilization section)

@traviscross traviscross removed the S-waiting-on-stabilization Waiting for a stabilization PR to be merged in the main Rust repository label Aug 6, 2026
@traviscross

Copy link
Copy Markdown
Contributor

Definitely appreciated. Thank you. And thanks to @ehuss for this PR.

@traviscross
traviscross added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 6, 2026
@traviscross
traviscross added this pull request to the merge queue Aug 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Aug 6, 2026
ehuss added 2 commits August 6, 2026 22:37
This moves it below to match the template of having behavioral rules
after the syntax.
This is to match the template order.
ehuss and others added 8 commits August 6, 2026 22:37
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.
Let's revise this section editorially.
@rustbot

rustbot commented Aug 6, 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.

@traviscross
traviscross enabled auto-merge August 6, 2026 22:37
@traviscross
traviscross added this pull request to the merge queue Aug 6, 2026
@traviscross

Copy link
Copy Markdown
Contributor

Apparently this isn't merging due to https://www.githubstatus.com/incidents/qcvjkzcs7j74.

Merged via the queue into rust-lang:master with commit 603630b Aug 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants