Clarify emoji complexity in the characters (char) exercise
Is your feature request related to a problem? Please describe.
While working on the characters (char) exercise, the instructions prompt the user to try an emoji:
// Try a letter, try a digit (in single quotes), try a special character, try a character from a different language than your own, try an emoji
If a user tries a complex emoji like a heart on fire (❤️) or a profession/gender-modified emoji, the compiler throws a character literal may only contain one codepoint error. This happens because these emojis are actually composed of multiple Unicode codepoints joined by Zero Width Joiners (ZWJ), which violates Rust's strict definition of a 4-byte single-codepoint char.
For beginners, this can be quite confusing since both `` and ❤️ visually look like a single "character" in their text editor.
Describe the solution you'd like
I would like to update the comment in the exercise file to explicitly mention using a simple emoji (one that consists of a single codepoint) and briefly warn that composite emojis will cause a compilation error.
For example, updating the comment from:
// Try a letter, try a digit (in single quotes), try a special character, try a character
// from a different language than your own, try an emoji To something like:
// Try a letter, try a digit (in single quotes), try a special character, try a character
// from a different language than your own, try a simple emoji (avoid composite emojis
// like ❤️ which consist of multiple Unicode codepoints!)Describe alternatives you've considered
An alternative would be leaving it as is, but it frequently catches learners off guard when they choose a modern, multi-codepoint emoji from their system picker.
Additional context
Tested on Rust stable. The issue stems from the fundamental difference between a Rust char (a single Unicode Scalar Value) and an extended grapheme cluster.
Source: Exercice
https://github.com/rust-lang/rustlings/blob/main/exercises/04_primitive_types/primitive_types2.rs
Cargo version: cargo 1.98.1 (797e8a9bc 2026-08-05)
Rustlings version: rustlings 6.5.0ls -la
total 60
drwxrwxr-x 7 devminds devminds 4096 sept. 22 12:59 .
drwxrwxr-x 4 devminds devminds 4096 sept. 22 12:57 ..
-rw-rw-r-- 1 devminds devminds 153 sept. 22 12:59 Cargo.lock
-rw-rw-r-- 1 devminds devminds 14591 sept. 22 12:57 Cargo.toml
drwxrwxr-x 27 devminds devminds 4096 sept. 22 12:57 exercises
drwxrwxr-x 7 devminds devminds 4096 sept. 22 12:57 .git
-rw-rw-r-- 1 devminds devminds 28 sept. 22 12:57 .gitignore
-rw-rw-r-- 1 devminds devminds 88 sept. 22 12:57 rust-analyzer.toml
-rw-rw-r-- 1 devminds devminds 210 sept. 22 19:32 .rustlings-state.txt
drwxrwxr-x 27 devminds devminds 4096 sept. 22 12:57 solutions
drwxrwxr-x 4 devminds devminds 4096 sept. 22 17:51 target
drwxrwxr-x 2 devminds devminds 4096 sept. 22 12:57 .vscodeOS
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu 24.04.5 LTS"
PRETTY_NAME="Ubuntu 24.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.5 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logoSource: rust-lang/rustlings