Skip to content

testsuite: Add compile-fail test for #5883 #7863

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from

Conversation

catamorphism
Copy link
Contributor

No description provided.

@bors bors closed this Jul 19, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 4, 2021
Properly consider uncased and titlecased characters.
Fixes rust-lang#7863.
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 4, 2021
…r=xFrednet

Fix `match_str_case_mismatch` on uncased chars

False positives would result because `char::is_lowercase` and friends will return `false` for non-alphabetic chars and alphabetic chars lacking case (such as CJK scripts). Care also has to be taken for handling titlecase characters (`Dz`) and lowercased chars with no uppercase equivalent (`ʁ`).

For example, when verifying lowercase:
 * Check `!any(char::is_ascii_uppercase)` instead of `all(char::is_ascii_lowercase)` for ASCII.
 * Check that `all(|c| c.to_lowercase() == c)` instead of `all(char::is_lowercase)` for non-ASCII

Fixes rust-lang#7863.

changelog: Fix false positives in [`match_str_case_mismatch`] on uncased characters
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants