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

Lint against lowercase static mut #37162

Merged
merged 3 commits into from
Oct 17, 2016
Merged

Conversation

matklad
Copy link
Member

@matklad matklad commented Oct 14, 2016

Closes #37145.

Lint for non mut statics was added in #7523, and it explicitly did not cover mut statics. I am not sure why.

@rust-highfive
Copy link
Collaborator

r? @arielb1

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

@matklad matklad force-pushed the static-mut-lint branch 2 times, most recently from 5147918 to 6f216f6 Compare October 14, 2016 13:22
Copy link
Contributor

@jseyfried jseyfried left a comment

Choose a reason for hiding this comment

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

Thanks! r=me with the comment addressed.

hir::ItemStatic(_, hir::MutImmutable, _) => {
NonUpperCaseGlobals::check_upper_case(cx, "static constant", it.name, it.span);
}
hir::ItemStatic(_, hir::MutMutable, _) => {
NonUpperCaseGlobals::check_upper_case(cx, "static variable", it.name, it.span);
}
Copy link
Contributor

@jseyfried jseyfried Oct 15, 2016

Choose a reason for hiding this comment

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

I think the above two arms could be merged into a single arm:

    hir::ItemStatic(..) => {
        NonUpperCaseGlobals::check_upper_case(cx, "static variable", it.name, it.span);
    }

@jseyfried
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Oct 17, 2016

📌 Commit 066d62d has been approved by jseyfried

@bors
Copy link
Contributor

bors commented Oct 17, 2016

⌛ Testing commit 066d62d with merge 07b86d0...

bors added a commit that referenced this pull request Oct 17, 2016
Lint against lowercase static mut

Closes #37145.

Lint for non mut statics was added in #7523, and it explicitly did not cover mut statics. I am not sure why.
@matklad
Copy link
Member Author

matklad commented Oct 17, 2016

This may produce new warnings. Should the relnotes label be applied?

@alexcrichton
Copy link
Member

Yeah, let's tag

@alexcrichton alexcrichton added the relnotes Marks issues that should be documented in the release notes of the next release. label Oct 17, 2016
@bors bors merged commit 066d62d into rust-lang:master Oct 17, 2016
@matklad matklad deleted the static-mut-lint branch July 9, 2019 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants