Add suggestions for using #[export_name] instead of #[link_name] on static#159253
Open
asuto15 wants to merge 2 commits into
Open
Add suggestions for using #[export_name] instead of #[link_name] on static#159253asuto15 wants to merge 2 commits into
#[export_name] instead of #[link_name] on static#159253asuto15 wants to merge 2 commits into
Conversation
Collaborator
|
Some changes occurred in compiler/rustc_attr_parsing |
Collaborator
|
r? @TaKO8Ki rustbot has assigned @TaKO8Ki. Use Why was this reviewer chosen?The reviewer was selected based on:
|
JonathanBrouwer
requested changes
Jul 25, 2026
Collaborator
|
Reminder, once the PR becomes ready for a review, use |
Contributor
Author
|
@rustbot ready |
JonathanBrouwer
approved these changes
Jul 26, 2026
Contributor
This comment has been minimized.
This comment has been minimized.
Contributor
|
@bors r- |
Contributor
|
This pull request was unapproved. |
asuto15
force-pushed
the
suggest-export-name
branch
from
July 26, 2026 13:04
b4fec82 to
5e5367b
Compare
Collaborator
|
This PR was rebased onto a different main 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. |
Contributor
|
@bors r+ rollup |
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jul 27, 2026
…athanBrouwer Add suggestions for using `#[export_name]` instead of `#[link_name]` on static Fixes rust-lang#159247. This adds a suggestion for using `#[unsafe(export_name = "...")]` when `#[link_name = "..."]` is applied to a static. It also handles the existing `#[unsafe(link_name = "...")]` form by replacing only the attribute name. Tested with: - `./x test tests/ui/attributes/link-name-on-static.rs` - `./x test tests/ui/attributes/unsafe-link-name-on-static.rs`
rust-bors Bot
pushed a commit
that referenced
this pull request
Jul 27, 2026
…uwer Rollup of 8 pull requests Successful merges: - #159085 (Fix decoding attributes of `SyntheticCoroutineBody`) - #159554 (feat: Update method signature of int_from_ascii) - #159637 (Some place analysis tweaks) - #159961 (sanitize_standard_fds: Miri supports poll now) - #159967 (rustc_target: callconv: mips64: Return structs with single f128 in FPRs) - #159253 (Add suggestions for using `#[export_name]` instead of `#[link_name]` on static) - #159840 (Fix opaque type ICE in late lints under the next-generation trait solver) - #159956 (Fix observable intermediate state in `thread::add_spawn_hook`)
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.
Fixes #159247.
This adds a suggestion for using
#[unsafe(export_name = "...")]when#[link_name = "..."]is applied to a static.It also handles the existing
#[unsafe(link_name = "...")]form by replacing only the attribute name.Tested with:
./x test tests/ui/attributes/link-name-on-static.rs./x test tests/ui/attributes/unsafe-link-name-on-static.rs