4 ms·
The compiler will warn about potentially confusing situations involving different scripts. For example, using identifiers that look very similar will result in
by joosters 5y ago
The compiler will warn about potentially confusing situations involving different scripts. For example, using identifiers that look very similar will result in a warning.
Unfortunately, I've little experience of rust, so I don't have experience of that warning. It would certainly help catch a one-liner exploit, but wouldn't it be excessively noisy for code written in non-english languages?
- wongarsu 5y agoIt only warns if there actually are two identifiers that look similar. Even if it's not malicious it's still confusing and is worth renaming. But if you want to, turning off specific warnings for a file or block of code is really simple in rust, just add "#[allow(confusable_idents)]"
- estebank 5y agoThe Unicode homoglyph lint will only trigger if there are multiple identifiers that can look the same, it's not a blanket warning on anything that isn't ASCII. It's close to what browsers do with domain names. And you can always allow lints.