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

Check for allow(..) attributes in case check diagnostic #6421

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

popzxc
Copy link
Contributor

@popzxc popzxc commented Oct 31, 2020

Resolves #6348

This is not a full-fledged solution, as it doesn't looks up for parent elements (e.g. function -> module -> parent module -> crate root), but it does at least checks attributes of item being checked.
I played a bit with code, and it seems that implementing a proper solution (which will also check for deny / warn attributes overriding values for allows from above).

So, this solution should fix all the macros which intentionally do "weird" naming and wrap it with allow, such as lazy_static.

cc @ArifRoktim

Copy link
Member

@matklad matklad left a comment

Choose a reason for hiding this comment

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

LGTM, but needs a rebase

bors d+

crates/hir_ty/src/diagnostics/decl_check.rs Outdated Show resolved Hide resolved
crates/hir_ty/src/diagnostics/decl_check.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors bot commented Nov 2, 2020

✌️ popzxc can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@popzxc
Copy link
Contributor Author

popzxc commented Nov 3, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Nov 3, 2020

@bors bors bot merged commit 65b44d2 into rust-lang:master Nov 3, 2020
@popzxc popzxc deleted the case-check-allow branch November 3, 2020 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IncorrectCase diagnostic thinks lazy_static refs should be camel cased
4 participants