Update no_mangle to use the attribute template - #1904
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
|
Can we land this? it's blocking rust-lang/rust#154585 |
RalfJung
reviewed
Jul 29, 2026
| `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. |
Member
There was a problem hiding this comment.
With rust-lang/rust#154585, no_mangle is forbidden on generic items.
This comment has been minimized.
This comment has been minimized.
traviscross
approved these changes
Aug 5, 2026
traviscross
enabled auto-merge
August 5, 2026 11:30
traviscross
disabled auto-merge
August 5, 2026 11:31
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
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) |
Contributor
|
Definitely appreciated. Thank you. And thanks to @ehuss for this PR. |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 6, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Aug 6, 2026
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.
This restriction is being added in rust-lang/rust#154585.
Let's revise this section editorially.
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
enabled auto-merge
August 6, 2026 22:37
Contributor
|
Apparently this isn't merging due to https://www.githubstatus.com/incidents/qcvjkzcs7j74. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New rules:
abi.no_mangle.syntaxabi.no_mangle.allowed-positionsabi.no_mangle.duplicatesabi.no_mangle.export_nameabi.no_mangle.ascii-onlyabi.no_mangle.generic