Clarify emoji complexity in the characters (char) exercise
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- documentation
Research direction
The file to edit is exercises/04_primitive_types/primitive_types2.rs. Look for the comment line that prompts trying an emoji. Update it to clarify using a simple emoji and warn about composite emojis. Verify by running the exercise with rustlings run primitive_types2 to ensure the comment compiles and the message is clear.
Written by the indexing model from the issue text.
Description
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.0
ls -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 .vscode
OS
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-logo
- Dominant language
- Rust
- Stars
- 64.6k
- Forks
- 11.3k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rustlings
-
A-exercises C-enhancement P-low
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Proposal: German (Deutsch) translation for Community ExercisesMay be free again @mo8it claimed this 62 days ago, and no pull request is open. Open
rust-lang/rustlings#2445 · 4 comments · 2 reactions · 1 assignee ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in rust-lang/rustlings
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CakeRepository/agentshangout#995 ·
-
area:frontend kind:bug priority:p3 ready
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day