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

[squash-merged] new lint: single_char_lifetime_names #8236

Closed
wants to merge 2 commits into from
Closed

[squash-merged] new lint: single_char_lifetime_names #8236

wants to merge 2 commits into from

Conversation

PatchMixolydic
Copy link
Contributor

@PatchMixolydic PatchMixolydic commented Jan 6, 2022

This pull request adds a lint against single character lifetime names, as they might not divulge enough information about the purpose of the lifetime. This can make code harder to understand. I placed this in restriction rather than pedantic (as suggested in #8233) since most of the Rust ecosystem already uses single character lifetime names (to my knowledge, at least) and since single character lifetime names aren't incorrect. I'd be happy to change this upon request, however. Fixes #8233.

  • Followed lint naming conventions
  • 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: [single_char_lifetime_names]

@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 @llogiq (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 6, 2022
Copy link
Contributor

@llogiq llogiq left a comment

Choose a reason for hiding this comment

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

Just one small nit

tests/ui/single_char_lifetime_names.rs Show resolved Hide resolved
@llogiq
Copy link
Contributor

llogiq commented Jan 9, 2022

Thank you! @bors r+ squash

@bors
Copy link
Collaborator

bors commented Jan 9, 2022

📌 Commit e0cec6b has been approved by llogiq

@bors
Copy link
Collaborator

bors commented Jan 9, 2022

⌛ Testing commit e0cec6b with merge 5991695...

bors added a commit that referenced this pull request Jan 9, 2022
…ogiq

new lint: `single_char_lifetime_names`

This pull request adds a lint against single character lifetime names, as they might not divulge enough information about the purpose of the lifetime. This can make code harder to understand. I placed this in `restriction` rather than `pedantic` (as suggested in #8233) since most of the Rust ecosystem already uses single character lifetime names (to my knowledge, at least) and since single character lifetime names aren't incorrect. I'd be happy to change this upon request, however. Fixes #8233.

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

changelog: new lint: [`single_char_lifetime_names`]
@bors
Copy link
Collaborator

bors commented Jan 9, 2022

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

This was referenced Jan 9, 2022
@PatchMixolydic PatchMixolydic changed the title new lint: single_char_lifetime_names [squash-merged] new lint: single_char_lifetime_names Jan 9, 2022
@PatchMixolydic
Copy link
Contributor Author

This seems to have landed in master ~5 hours ago, so I'm going to go ahead and close this.

@PatchMixolydic PatchMixolydic deleted the single_char_lifetime_names branch January 10, 2022 01:20
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.

Introduce a lint for single letter lifetimes
4 participants