Skip to content

Conversation

@GenericNerd
Copy link

I was playing around with zero width spaces in different programming languages and thought that this error message could be more helpful. Hopefully it's a good first contribution! :)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 8, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 8, 2026

r? @WaffleLapkin

rustbot has assigned @WaffleLapkin.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

// way.
let (token, sugg) =
unicode_chars::check_for_substitution(self, start, c, repeats + 1);
const INVISIBLE_CHARACTERS: [char; 8] = ['\u{200B}', '\u{200C}', '\u{2060}', '\u{2061}', '\u{2062}', '\u{00AD}', '\u{034F}', '\u{061C}'];
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any place this list could be sourced from so we don't need to maintain it in this specific place? There are definitely more as well. Maybe one of the unicode- crates provides it, @Manishearth would know.

Also having a const in the middle of a block is rather unidiomatic, if kept it should be moved to the top of the file.

Copy link
Author

Choose a reason for hiding this comment

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

I found a list of invisible characters here: https://www.editpad.org/tool/invisible-character. I only took ones that didn't actually take up a space.

I can move the const to the top of the file as well if that's more idiomatic.

@lukaslueg
Copy link
Contributor

@Bryntet
Copy link
Contributor

Bryntet commented Jan 8, 2026

clippy lint that does the same thing

this clippy lint only does this on string literals though from what I can tell

@GenericNerd GenericNerd force-pushed the lexer/help-invisible-character branch from 11d0da1 to a6212c5 Compare January 8, 2026 21:26
@Kivooeo
Copy link
Member

Kivooeo commented Jan 9, 2026

Could you please squash the commits?

@tgross35
Copy link
Contributor

tgross35 commented Jan 9, 2026

^ and drop the emojis pls, we know what a feature is even without the ✨ :)

@WaffleLapkin WaffleLapkin 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 Jan 9, 2026
@GenericNerd
Copy link
Author

^ and drop the emojis pls, we know what a feature is even without the ✨ :)

Is there any specific guidelines for commit messages? I was made semi-aware of squashing commits but was not made aware of how commits are meant to be formatted. I used the conventional commits extension in VSC so I'm just trying to make sure I only have to do this once!

@tgross35
Copy link
Contributor

Nothing too specific :) "conventional" prefixes like feat: are fine, as are area descriptors like lint:. A rule of thumb is just that if somebody reads the summary they should be able to loosely guess what changed.

Gitmoji is just pretty superfluous and doesn't match anything in the log, so we ask to avoid emojis in summaries.

@GenericNerd GenericNerd force-pushed the lexer/help-invisible-character branch from a6212c5 to 2b597f5 Compare January 10, 2026 14:31
@GenericNerd GenericNerd changed the title feat: ✨ invisible character help string feat: invisible character help string Jan 10, 2026
@GenericNerd
Copy link
Author

@rustbot ready

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

I assume you were taking a look at this / ready to approve based on the squash request, so

r? @Kivooeo

@rustbot rustbot assigned Kivooeo and unassigned WaffleLapkin Jan 11, 2026
@GenericNerd
Copy link
Author

I assume you were taking a look at this / ready to approve based on the squash request, so

r? @Kivooeo

My bad, I thought I just needed to put the status label back to waiting for review! I did squash the commits, removed the emoji and changed the title like you mentioned though :)

@Kivooeo
Copy link
Member

Kivooeo commented Jan 11, 2026

I asked for the commits to be squashed as there were quite a few small ones

I'll take a final look at the implementation later today - it's 6 am here and it's been a long day, I apologise in advance for any potential delays and appreciate your patience

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants