Skip to content

Fix camel case type warning for types with trailing underscores #54101

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

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Fix camel case type warning for types with trailing underscores #54101

merged 1 commit into from
Sep 19, 2018

Conversation

osa1
Copy link
Contributor

@osa1 osa1 commented Sep 10, 2018

Fixes #54099

@rust-highfive
Copy link
Contributor

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 10, 2018
@eddyb
Copy link
Member

eddyb commented Sep 10, 2018

r? @nikomatsakis cc @oli-obk @Manishearth It's not clear whether we should do this.

@Manishearth
Copy link
Member

I see no reason not to, there's no obvious way to "fix" this aside from inventing a new name

@@ -43,8 +43,6 @@ struct foo7 {
bar: isize,
}

type __ = isize; //~ ERROR type `__` should have a camel case name such as `CamelCase`
Copy link
Contributor

Choose a reason for hiding this comment

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

Well... The former message was not wrong per se. But pretty much useless

We should probably just add underscore-only identifiers to the https://rust-lang-nursery.github.io/rust-clippy/master/index.html#just_underscores_and_digits lint in clippy

@nikomatsakis
Copy link
Contributor

@osa1 your PR title says:

trailing underscores

but I don't see any test for that, just leading underscores. Perhaps add some more tests?

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 10, 2018
@nikomatsakis
Copy link
Contributor

Otherwise r=me, I agree that this makes sense to me.

@osa1
Copy link
Contributor Author

osa1 commented Sep 12, 2018

but I don't see any test for that, just leading underscores. Perhaps add some more tests?

Done!

struct __ {}
struct X_ {}
struct X__ {}
struct X___ {}
Copy link
Contributor

Choose a reason for hiding this comment

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

looking around, I couldn't find many tests for this lint really...

Copy link
Contributor

Choose a reason for hiding this comment

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

e.g., to see whether X_X would fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm I actually don't know the answer to that myself -- that is whether X_X is camel case or not. Btw there are a few more tests about this in lint-non-camel-case-types.rs.

@nikomatsakis
Copy link
Contributor

Anyway, I'm inclined to r+ this PR -- @oli-obk, @Manishearth, do we think we need an FCP here? I guess we could. Maybe I'll nominate for lang-team to discuss on Thu.

@nikomatsakis nikomatsakis added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Sep 12, 2018
@Manishearth
Copy link
Member

Manishearth commented Sep 12, 2018 via email

@nikomatsakis
Copy link
Contributor

We chatted in the lang team mtg and decided "oh what the heck we'll FCP it".

@nikomatsakis
Copy link
Contributor

I believe @Centril's exact quote was "I have never cared less about anything"

@nikomatsakis
Copy link
Contributor

@rfcbot fcp merge

I propose we allow any number of trailing or leading underscores because...why not.

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 13, 2018

Team member @nikomatsakis has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once a majority of reviewers approve (and none object), 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!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 13, 2018
@joshtriplett
Copy link
Member

🤷‍♂️ 👍

@Centril
Copy link
Contributor

Centril commented Sep 13, 2018

😪 💤 🛌
👍

@rfcbot
Copy link
Collaborator

rfcbot commented Sep 18, 2018

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Sep 18, 2018
@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Sep 18, 2018
@eddyb
Copy link
Member

eddyb commented Sep 18, 2018

Do we approve now, or wait some more?

@joshtriplett
Copy link
Member

@eddyb Go ahead.

@eddyb
Copy link
Member

eddyb commented Sep 18, 2018

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Sep 18, 2018

📌 Commit 07646bb has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 18, 2018
@bors
Copy link
Collaborator

bors commented Sep 19, 2018

⌛ Testing commit 07646bb with merge 4f3ff5a...

bors added a commit that referenced this pull request Sep 19, 2018
Fix camel case type warning for types with trailing underscores

Fixes #54099
@bors
Copy link
Collaborator

bors commented Sep 19, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing 4f3ff5a to master...

@bors bors merged commit 07646bb into rust-lang:master Sep 19, 2018
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Sep 28, 2018
@osa1 osa1 deleted the issue_54099 branch March 2, 2021 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.