rust-lang / rust-lang/rust

Warn on Fullwidth Exclamation Mark (U+FF01) in comment

Open
#134,810 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-lints A-Unicode C-feature-request T-compiler T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

//! A
//!B
//! C

For the above Rust source code, rustdoc produces documentation containing only "A C". The line containing "B" is only a comment. The comment starts with https://www.compart.com/en/unicode/U+FF01.

I caught this in a real-world documentation PR from a Chinese contributor. See https://github.com/rust-lang/rust/pull/134241#pullrequestreview-2523541705.

In GitHub, the distinction is practically invisible.

In my text editor, it is more obvious.

Would it be reasonable for rustc and/or rustdoc to have reported a lint on such code?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by investigating how rustc and rustdoc recognize documentation comments and how existing lints report suspicious Unicode; define done as a warning for a comment beginning with U+FF01 without changing ordinary comment handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.