report improper_ctypes lints from external macros - #160870
Conversation
|
r? @khyperia rustbot has assigned @khyperia. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
thanks for the PR, we appreciate it! ❤️
hmm, why are you mentioning this? |
|
when I was adding report_in_external_macro to the two lints.. saw USES_POWER_ALIGNMENT sitting just below them in the same pass. it confused me for a second on whether I should touch it too then realized it was completely unrelated... but taught it would be better to add this for more clarification... |
|
right, thanks! this looks good to me, but I'm unsure of the review process for lint changes like this, especially because the issue was just created and you posted a PR to fix it immediately, and am inexperienced with estimating lint ecosystem impact/etc. - e.g. if the macro comes from a third party crate you can't easily update. So, rerolling for that perspective, and I'll listen/learn for next time~ @rustbot reroll |
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_macroforimproper_ctypesandimproper_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