-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
non_ascii_idents
lint (part of RFC 2457)
#61883
Conversation
impl EarlyLintPass for NonAsciiIdents { | ||
fn check_ident(&mut self, cx: &EarlyContext<'_>, ident: ast::Ident) { | ||
if !ident.name.as_str().is_ascii() { | ||
let mut err = cx.struct_span_lint( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use let mut err =
here; just chain .emit()
onto cx.struct_span_lint(...)
.
@@ -0,0 +1,11 @@ | |||
#![feature(non_ascii_idents)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you move this into a folder under ui/lint/
dedicated to RFC 2457 (since there are more lints to add later...)
merging this: |
📌 Commit 0ae61d8 has been approved by |
the pr doesn't need to block on that. can be fixed in a separate PR
Thanks @Dylan-DPC. Although—I was planning to fix it! Sorry I've been so busy lately! |
@zackmdavis A follow up would be great. :) |
Don't worry. Your lack of time could be a gift for someone waiting for a chance to contribute to the language 😄 |
…=Manishearth `non_ascii_idents` lint (part of RFC 2457) RFC 2457 [declares](https://github.com/rust-lang/rfcs/blob/121bbeff500c3274cea22c7e0ca176274d592646/text/2457-non-ascii-idents.md): "A `non_ascii_idents` lint is added to the compiler. This lint is allow by default." (Part of rust-lang#55467.) r? @Manishearth
⌛ Testing commit 0ae61d8 with merge ac686e2d827323431587aa79ae6901abba6f1fce... |
💔 Test failed - checks-azure |
☔ The latest upstream changes (presumably #61988) made this pull request unmergeable. Please resolve the merge conflicts. |
RFC 2457 declares: "A `non_ascii_idents` lint is added to the compiler. This lint is allow by default."
0ae61d8
to
6de8e39
Compare
@bors r=Manishearth |
📌 Commit 6de8e39 has been approved by |
…=Manishearth `non_ascii_idents` lint (part of RFC 2457) RFC 2457 [declares](https://github.com/rust-lang/rfcs/blob/121bbeff500c3274cea22c7e0ca176274d592646/text/2457-non-ascii-idents.md): "A `non_ascii_idents` lint is added to the compiler. This lint is allow by default." (Part of rust-lang#55467.) r? @Manishearth
⌛ Testing commit 6de8e39 with merge 0ac1b84af9fd38d43c174a5a1222478cfaa6451e... |
…=Manishearth `non_ascii_idents` lint (part of RFC 2457) RFC 2457 [declares](https://github.com/rust-lang/rfcs/blob/121bbeff500c3274cea22c7e0ca176274d592646/text/2457-non-ascii-idents.md): "A `non_ascii_idents` lint is added to the compiler. This lint is allow by default." (Part of rust-lang#55467.) r? @Manishearth
@bors retry rolled up. |
Rollup of 4 pull requests Successful merges: - #61883 (`non_ascii_idents` lint (part of RFC 2457)) - #62042 (Support stability and deprecation checking for all macros) - #62213 (rustdoc: set cfg(doctest) when collecting doctests) - #62286 (Check if the archive has already been added to avoid duplicates) Failed merges: r? @ghost
RFC 2457 declares: "A
non_ascii_idents
lint is added to the compiler. This lint is allow by default."(Part of #55467.)
r? @Manishearth