Skip to content

report improper_ctypes lints from external macros - #160870

Open
im-lunex wants to merge 1 commit into
rust-lang:mainfrom
im-lunex:fix_#160862
Open

report improper_ctypes lints from external macros#160870
im-lunex wants to merge 1 commit into
rust-lang:mainfrom
im-lunex:fix_#160862

Conversation

@im-lunex

@im-lunex im-lunex commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

FFI safety belongs to the types being defined, not the macro generating the extern function. Currently, cross-crate macros trigger a heuristic that silently drops these warnings.

This PR enables report_in_external_macro for improper_ctypes and improper_ctypes_definitions. Warnings now emit as expected, while code suggestions stay suppressed for external spans.

uses_power_alignment is untouched as it follows a separate emission path.

Fixes #160862

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 10, 2026
@rustbot

rustbot commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

r? @khyperia

rustbot has assigned @khyperia.
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: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

@im-lunex
im-lunex marked this pull request as draft August 10, 2026 17:41
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2026
@im-lunex
im-lunex marked this pull request as ready for review August 10, 2026 17:47
@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 (such as code changes or more information) from the author. labels Aug 10, 2026
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improper_ctypes_definitions is sometimes (but not always) bypassed by cross-crate macros

3 participants