rust-lang / rust-lang/rust

rustdoc UI: Warning block icon is no longer a circle (on my machine) but a squircle

Open
#144,778 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-rustdoc-ui C-bug regression-untriaged S-needs-repro T-rustdoc T-rustdoc-frontend
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Reproducer:

//! <div class="warning"></div>

Current output (FF 140.0.2, Linux, rustdoc 1.90.0 nightly 2025-07-30 3048886e5):

Image

Expected output (copied over from https://github.com/rust-lang/rust/pull/106561, only consider the icon not the rest):

Image

I think this is a regression (on my machine) but I can't retroactively find a "good version". I've tried 1.74 (first stable version to include this feature) and 1.75 to no avail (it's not a circle). Maybe it's always been that way on my machine, I don't remember. I did remove the doc/ folder before trying a different version and I did hard-refresh.


The "i" is ⓘ, U+24D8 Circled Latin Small Letter I and I believe it's rendered with font Fire Sans, however I don't know how to confirm that using the FF dev-tools since I can't seem to inspect the computed style of pseudo elements. We do serve a local copy of Fira Sans if not available:

https://github.com/rust-lang/rust/blob/e3ee7f7aea5b45af3b42b5e4713da43876a65ac9/src/librustdoc/html/static/css/rustdoc.css#L73-L80

And for me it should serve that copy since I don't have Fira Sans installed (fc-list | rg Fira has empty output). Now, the font-face rule I've linked above declares the weight to be 400 which seems to check out with what I'm seeing. Then, I've checked how ⓘ (U+24D8) gets rendered per Fira Sans weight (https://fonts.google.com/specimen/Fira+Sans?preview.text=%E2%93%98) and that's what I'm seeing in my browser (image is edited to compact the data):

Image

So whether the i is circled or surrounded by a squircle seems to depend on the weight (for everyone?) and since we pick a weight of 400, it's not a circle (for me). If we picked 300 or 600, it should render as circle.

I'm wondering tho, is it only me who has this issue? Since it renders like a squircle for me even on the introductory version 1.74 I feel like my setup is busted. What?

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

Start in src/librustdoc/html/static/css/rustdoc.css, especially the font-face rule around lines 73–80, and reproduce the warning block with the supplied Rust snippet in Firefox. Compare the rendered icon across the relevant Fira Sans weights and determine a CSS or font choice that matches the expected circle; done means the warning icon renders consistently as a circle.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, rust
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.