Skip to content

rustdoc: Regression in display of macro_rules! matchers #86208

Closed
@camelid

Description

@camelid

Oddly enough, the two lines (and the areas around them) that show up when I grep for "macro_rules! in rustdoc don't appear to have changed at all in a while, so I'm not sure what caused this regression. Perhaps the span of the matcher changed? I wasn't able to reproduce this locally, even when I tried using a cross-crate re-export with a copy-pasted version of core::todo (modulo replacing $crate:: with ::std::). Also, the bug doesn't appear with, e.g., panic!, but does with compile_error!. So, this seems to be a subtle bug.

$ rg '"macro_rules!' src/librustdoc/
src/librustdoc/clean/mod.rs
2167:                "macro_rules! {} {{\n{}}}",

src/librustdoc/clean/inline.rs
541:                "macro_rules! {} {{\n{}}}",

beta (incorrect)

image

stable (correct)

image

Metadata

Metadata

Assignees

Labels

A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.P-highHigh priorityT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions