Skip to content

fix: missing_transmute_annotations should not contain fn name in suggestion - #17611

Open
GTimothy wants to merge 2 commits into
rust-lang:masterfrom
GTimothy:missing_transmute_annotation_parent_function
Open

fix: missing_transmute_annotations should not contain fn name in suggestion#17611
GTimothy wants to merge 2 commits into
rust-lang:masterfrom
GTimothy:missing_transmute_annotation_parent_function

Conversation

@GTimothy

@GTimothy GTimothy commented Aug 23, 2026

Copy link
Copy Markdown

fixes #15839: missing_transmute_annotations containing fn name in suggestion (such as main) which fails to resolve

changelog:[missing_transmute_annotations]: remove function names from the suggestion

@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome!

You should hear from one of our reviewers after this PR gets at least 2 reviews from the community.

Please see the contribution instructions for more information.

@rustbot rustbot added S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 23, 2026

@CommanderStorm CommanderStorm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Community review: LGTM

View changes since this review

Comment thread tests/ui/missing_transmute_annotations.rs Outdated
@GTimothy

Copy link
Copy Markdown
Author

Should I squash or keep in two commits?

@DanielEScherzer DanielEScherzer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

community review: looks good to me, I think the commits can be kept separate

View changes since this review

@rustbot rustbot removed the S-waiting-on-community-reviews Status: This is awaiting for positive reviews from the community before a maintainer is assigned. label Aug 23, 2026
@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

r? @Jarcho

rustbot has assigned @Jarcho for the project review.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: 9 candidates
  • 9 candidates expanded to 9 candidates
  • Random selection from Jarcho, Manishearth, blyxyas, dswij, llogiq

@ada4a

ada4a commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@GTimothy could you please reorder the commits so that the actual change comes last? That would make it easier to revert just that commit, if need be. (This is also the reason why keeping drive-by clean-ups as a separate commit is preferred, and much appreciated)

@ada4a ada4a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix looks good, thank you:) Left a few nits about testing

View changes since this review

Comment thread tests/ui/missing_transmute_annotations.rs Outdated
Comment thread tests/ui/missing_transmute_annotations.rs Outdated
Comment thread tests/ui/missing_transmute_annotations.rs
Comment thread tests/ui/missing_transmute_annotations.rs Outdated
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Aug 23, 2026
@rustbot

rustbot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@GTimothy
GTimothy force-pushed the missing_transmute_annotation_parent_function branch from 00d1c2a to e07efdf Compare August 23, 2026 21:39
@GTimothy

Copy link
Copy Markdown
Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Aug 23, 2026

@ada4a ada4a left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Personally I consider with_types_for_suggestion to be a somewhat ugly hack... But I guess we could use this fix for now, and whoever comes up with a better solution than with_types_for_suggestion in the future could change this lint accordingly.

git nit: your second commit now contains the messages from both commits 😅

View changes since this review

Comment thread tests/ui/missing_transmute_annotations.rs Outdated
@GTimothy
GTimothy force-pushed the missing_transmute_annotation_parent_function branch from e07efdf to a48f4f2 Compare August 23, 2026 22:18
@GTimothy

GTimothy commented Aug 23, 2026

Copy link
Copy Markdown
Author

Personally I consider with_types_for_suggestion to be a somewhat ugly hack... But I guess we could use this fix for now, and whoever comes up with a better solution than with_types_for_suggestion in the future could change this lint accordingly.

It felt weird to use :) but it was the solution to the issue you referenced in the original issue.

git nit: your second commit now contains the messages from both commits 😅

I did some git gymnastics, splitting the commit before being able to reorder without conflict and squashed but did not cleanup after, fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing_transmute_annotations has containing fn name in suggestion (such as main) which fails to resolve

6 participants