Stream: t-compiler

Topic: Implementing `uncommon_codepoints` lint


Charles Lew (Jan 02 2020 at 05:31, on Zulip):

@Vadim Petrochenkov I want to have a try implementing the uncommon_codepoints lint. But I'm not sure where is the appropriate position to implement this checking. I think implementing it on lexer will cause a lot of repetitive checking, and want to avoid it if possible.

Charles Lew (Jan 02 2020 at 05:31, on Zulip):

https://github.com/rust-lang/rfcs/blob/master/text/2457-non-ascii-idents.md#exotic-codepoint-detection
https://github.com/rust-lang/rust/issues/55467

Vadim Petrochenkov (Jan 02 2020 at 10:03, on Zulip):

I think implementing it on lexer will cause a lot of repetitive checking

Why? Lexer doesn't do its work repeatedly.

Vadim Petrochenkov (Jan 02 2020 at 10:04, on Zulip):

Lexer (or proc macro server) creates a token once, then it can be cloned, passed, etc. without any lexer participation.

Charles Lew (Jan 02 2020 at 11:04, on Zulip):

I thought this will cause repetitive checking on different usages of the same identifier? Or should i cache the Symbol value somehow?

Charles Lew (Jan 02 2020 at 11:13, on Zulip):

I searched around and didn't find any lint-related code around in the lexer... Am i the first one adding a lint there? What should i do to make use of the lint infrastructure described in https://rust-lang.github.io/rustc-guide/diagnostics.html#lints ?

Charles Lew (Jan 02 2020 at 11:28, on Zulip):

Maybe i should insert my implementation into https://github.com/rust-lang/rust/blob/master/src/librustc_lint/non_ascii_idents.rs ? Seems much easier...

Esteban K├╝ber (Jan 02 2020 at 16:08, on Zulip):

I started looking at this a couple of weeks back, I can help you with the implementation

centril (Jan 02 2020 at 16:08, on Zulip):

https://github.com/rust-lang/rust/pull/67810

Last update: May 26 2020 at 11:10UTC