rust-lang / rust-lang/rust

Ignored example in warning block causes the warning icon for the example to be misaligned

Open
#162,945 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug needs-triage T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Code

/// <div class="warning">
///
/// ```ignore
/// XXX
/// ```
///
/// </div>
struct X;

Reproduction Steps

cargo doc

Expected Outcome

The icon is not misaligned

Local

Image

docs.rs

https://docs.rs/gu/latest/gu/num/traits/trait.Unsigned.html
Image

Actual Output

The icon is misaligned

Local

Image

doc.rs

https://docs.rs/gu/latest/gu/num/traits/trait.Unsigned.html
Image

Version

Local

rustdoc 1.98.1 (48a229cea 2026-09-01)

docs.rs

rustdoc 1.100.0-nightly (330d31712 2026-09-17)

Firefox

155.0.1 on windows 11

Additional Details

  • As seen above in the docs.rs screenshots, the contrast is bad (very under the ayu theme) so that is another issue even if alignment is fixed
  • Another issue is that the icon is a link (linking to #) when it should not be (this is true of both examples in the docs.rs link above), and specifically on docs.rs it is underlined when nested

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

Reproduce the issue by running cargo doc on the warning block containing the ignored Rust example, then compare the generated output with the local and docs.rs screenshots. Trace the rustdoc-generated warning icon and example markup, and consider alignment, contrast, and the unexpected link behavior; done means the icon renders correctly without introducing these related issues.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.