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

Add borrow_as_ptr lint #8210

Merged
merged 1 commit into from
Jan 11, 2022
Merged

Add borrow_as_ptr lint #8210

merged 1 commit into from
Jan 11, 2022

Conversation

guerinoni
Copy link
Contributor

@guerinoni guerinoni commented Jan 2, 2022

Closes: #6995

  • Followed [lint naming conventions][lint_naming]
  • Added passing UI tests (including committed .stderr file)
  • cargo test passes locally
  • Executed cargo dev update_lints
  • Added lint documentation
  • Run cargo dev fmt

changelog: new lint: [borrow_as_ptr]

@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 Jan 2, 2022
/// ```
#[clippy::version = "1.60.0"]
pub BORROW_AS_PTR,
correctness,
Copy link
Member

Choose a reason for hiding this comment

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

definitely not correctness, I'd say style? It can be incorrect in some cases but it's also a pattern used a lot by people.

Honestly, kinda feel like we might want to start with pedantic.

I think it's a correctness issue when dealing with e.g. MaybeUninit, but otherwise this is a common pattern

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched to style :)

@bors
Copy link
Contributor

bors commented Jan 9, 2022

☔ The latest upstream changes (presumably #8236) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Jan 11, 2022

☔ The latest upstream changes (presumably #8260) made this pull request unmergeable. Please resolve the merge conflicts.

Closes: #6995

Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com>
Co-authored-by: Paolo Barbolini <paolo@paolo565.org>
@Manishearth
Copy link
Member

Manishearth commented Jan 11, 2022

@bors r+

thanks for being patient!

@bors
Copy link
Contributor

bors commented Jan 11, 2022

📌 Commit 3298de7 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Jan 11, 2022

⌛ Testing commit 3298de7 with merge fd9cebe...

@bors
Copy link
Contributor

bors commented Jan 11, 2022

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

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.

New lint: prefer addr_of and addr_of_mut
4 participants