-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Lint on fn pointers comparisons in external macros #134536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
r? compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like it could be more generalized, but fine for now.
Specifically linting in macros seems like a much larger extension of the lint, though. Was this ever discussed by T-lang? |
Though I agree with it in theory. |
Yeah, linting on external macros made me hesitate to put it in the same PR as linting on Anyway, cc @traviscross |
@rustbot labels +I-lang-nominated +T-lang We did talk about the Here are some notes on that unanswered question, from an earlier set of minutes:
|
…er-errors Also lint on option of function pointer comparisons This PR is the first part of rust-lang#134536, ie. the linting on `Option<{fn ptr}>` in the `unpredictable_function_pointer_comparisons` lint, which isn't part of the lang nomination that the second part is going trough, and so should be able to be approved independently. Related to rust-lang#134527 r? `@compiler-errors`
Rollup merge of rust-lang#134586 - Urgau:fn-ptr-lint-option, r=compiler-errors Also lint on option of function pointer comparisons This PR is the first part of rust-lang#134536, ie. the linting on `Option<{fn ptr}>` in the `unpredictable_function_pointer_comparisons` lint, which isn't part of the lang nomination that the second part is going trough, and so should be able to be approved independently. Related to rust-lang#134527 r? `@compiler-errors`
This comment was marked as resolved.
This comment was marked as resolved.
I have extracted the This PR is now only about linting in external macros. |
This is still waiting on T-lang @rustbot team |
@rfcbot fcp merge We talked about this in lang triage today. Personally, I've warmed to the idea that if we've decided to lint against these comparisons then, yes, we should lint against them everywhere, and people can add the |
Team member @traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
@rfcbot reviewed @rfcbot concern explain to the user where to put the allow attribute on derives From the test, it looks like you have to place the If we can't do either of those, can we guide the user by telling them where to put the allow attribute they aren't confused? Otherwise I'm in favor of this change. |
The |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
This PR extends the recently stabilized
unpredictable_function_pointer_comparisons
lintto also lint onas well as linting in external macros (as to catchOption<{function pointer}>
andassert_eq!
and others).Fixes #134527