rust-clippy icon indicating copy to clipboard operation
rust-clippy copied to clipboard

Add new `UNSTABLE_INTRINSICS_WITH_STABLE_WRAPPER` lint

Open GuillaumeGomez opened this issue 1 year ago • 3 comments

Fixes #2997.

To prevent having to keep the list of intrinsics with stable counterpart up-to-date on clippy side, I instead check if the documentation contains the sentence "does not have a stable counterpart". To prevent running this check more than once, I store all the non-matching intrinsics DefId into a static.

r? @llogiq

changelog: Add new UNSTABLE_INTRINSICS_WITH_STABLE_WRAPPER lint

GuillaumeGomez avatar Feb 04 '24 17:02 GuillaumeGomez

Interestingly enough, we cannot differentiate between the intrinsics item and the "reexported" one (like for std::ptr::write_bytes). I'll try to extract more information to ensure which call is actually performed.

GuillaumeGomez avatar Feb 04 '24 21:02 GuillaumeGomez

Took me a while to realize that the error was coming from the doc example... ^^'

PR is now ready!

GuillaumeGomez avatar Feb 05 '24 15:02 GuillaumeGomez

:umbrella: The latest upstream changes (presumably #12306) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Feb 19 '24 09:02 bors

Hey @GuillaumeGomez , this is a ping from triage. There hasn't been any activity for some time, perhaps it was forgotten?

@rustbot author

J-ZhengLi avatar May 16 '24 15:05 J-ZhengLi

I'll close it because it should likely be a rustc lint directly.

GuillaumeGomez avatar May 16 '24 15:05 GuillaumeGomez