Repository navigation
Update no_mangle to use the attribute template - #1904
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Can we land this? it's blocking rust-lang/rust#154585 |
| `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. |
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.
…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
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
…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
…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
|
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) |
|
Definitely appreciated. Thank you. And thanks to @ehuss for this PR. |
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.
|
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. |
|
Apparently this isn't merging due to https://www.githubstatus.com/incidents/qcvjkzcs7j74. |
Update books ## rust-lang/reference 9 commits in afdc77bab886d4455c11247cdd32391bfab636ae..82da570bafd9efed421bdbae0f8603ede8dd308b 2026-08-08 22:04:17 UTC to 2026-07-28 18:20:15 UTC - add c-variadic function definitions (rust-lang/reference#2177) - Update `no_mangle` to use the attribute template (rust-lang/reference#1904) - enums with fields: clarify that repr(C, int) is quite different from repr(int) (rust-lang/reference#2227) - aliasing rules also apply inside private fields (rust-lang/reference#2304) - attributes: do not explain syntax in rules (rust-lang/reference#2306) - Document prohibition on inner attribute macros (rust-lang/reference#2311) - Use authentication for linkcheck (rust-lang/reference#2319) - Stabilize passing 128-bit integers via vector registers with `asm!` on x86 (rust-lang/reference#2313) - Add a rule for attribute macro outline modules (rust-lang/reference#2310)
Rollup merge of #160866 - rustbot:docs-update, r=traviscross Update books ## rust-lang/reference 9 commits in afdc77bab886d4455c11247cdd32391bfab636ae..82da570bafd9efed421bdbae0f8603ede8dd308b 2026-08-08 22:04:17 UTC to 2026-07-28 18:20:15 UTC - add c-variadic function definitions (rust-lang/reference#2177) - Update `no_mangle` to use the attribute template (rust-lang/reference#1904) - enums with fields: clarify that repr(C, int) is quite different from repr(int) (rust-lang/reference#2227) - aliasing rules also apply inside private fields (rust-lang/reference#2304) - attributes: do not explain syntax in rules (rust-lang/reference#2306) - Document prohibition on inner attribute macros (rust-lang/reference#2311) - Use authentication for linkcheck (rust-lang/reference#2319) - Stabilize passing 128-bit integers via vector registers with `asm!` on x86 (rust-lang/reference#2313) - Add a rule for attribute macro outline modules (rust-lang/reference#2310)
Update books ## rust-lang/reference 9 commits in afdc77bab886d4455c11247cdd32391bfab636ae..82da570bafd9efed421bdbae0f8603ede8dd308b 2026-08-08 22:04:17 UTC to 2026-07-28 18:20:15 UTC - add c-variadic function definitions (rust-lang/reference#2177) - Update `no_mangle` to use the attribute template (rust-lang/reference#1904) - enums with fields: clarify that repr(C, int) is quite different from repr(int) (rust-lang/reference#2227) - aliasing rules also apply inside private fields (rust-lang/reference#2304) - attributes: do not explain syntax in rules (rust-lang/reference#2306) - Document prohibition on inner attribute macros (rust-lang/reference#2311) - Use authentication for linkcheck (rust-lang/reference#2319) - Stabilize passing 128-bit integers via vector registers with `asm!` on x86 (rust-lang/reference#2313) - Add a rule for attribute macro outline modules (rust-lang/reference#2310)
New rules:
abi.no_mangle.syntaxabi.no_mangle.allowed-positionsabi.no_mangle.duplicatesabi.no_mangle.export_nameabi.no_mangle.ascii-onlyabi.no_mangle.generic