-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
trigger ptr_as_ptr
inside macros
#8442
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Manishearth (or someone else) soon. Please see the contribution instructions for more information. |
clippy_lints/src/casts/mod.rs
Outdated
@@ -419,6 +419,8 @@ impl_lint_pass!(Casts => [ | |||
|
|||
impl<'tcx> LateLintPass<'tcx> for Casts { | |||
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { | |||
ptr_as_ptr::check(cx, expr, &self.msrv); |
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.
I think we should still check if it's from an external crate?
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.
True, I was about to create a test case to see if it triggers from a macro in an external crate. I'll try to figure out how to do that.
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.
You may look into tests/ui/auxillary/macro_rules.rs
for some examples.
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.
Fixed :)
3bcc67e
to
aaeeed6
Compare
@bors r+ |
📌 Commit aaeeed6 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This PR makes
ptr_as_ptr
trigger inside macrosFixes issue #8120
changelog:
[`ptr_as_ptr`]
is now triggered inside macrosr? @llogiq