Skip to content
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

Merged
merged 1 commit into from
Feb 17, 2022
Merged

Conversation

rsmantini
Copy link
Contributor

@rsmantini rsmantini commented Feb 17, 2022

This PR makes ptr_as_ptr trigger inside macros

Fixes issue #8120

changelog: [`ptr_as_ptr`] is now triggered inside macros

r? @llogiq

@rust-highfive
Copy link

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 17, 2022
@@ -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);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed :)

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Feb 17, 2022

📌 Commit aaeeed6 has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Feb 17, 2022

⌛ Testing commit aaeeed6 with merge 76f91b6...

@bors
Copy link
Collaborator

bors commented Feb 17, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 76f91b6 to master...

@bors bors merged commit 76f91b6 into rust-lang:master Feb 17, 2022
@rsmantini rsmantini deleted the issue-8120-fix branch February 19, 2022 21:03
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants