Skip to content

rustdoc: Show use-site paths for unevaluated const array lengths#158334

Open
lapla-cogito wants to merge 1 commit into
rust-lang:mainfrom
lapla-cogito:rustdoc_typeconst
Open

rustdoc: Show use-site paths for unevaluated const array lengths#158334
lapla-cogito wants to merge 1 commit into
rust-lang:mainfrom
lapla-cogito:rustdoc_typeconst

Conversation

@lapla-cogito

@lapla-cogito lapla-cogito commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

After #158171, I noticed a few additional issues with the rendering of consts in rustdoc. This PR fixes them. When rendering array lengths, avoid inlining the full definition of unevaluated constants via print_inlined_const. Instead, fall back to Const::to_string() for use-site rendering, matching the behavior already used for projections without bodies.

r? camelid

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants