Skip to content

Incorrect rustdoc rendering of const generic default #133848

Open
@bjorn3

Description

@bjorn3

I tried this code:

https://doc.rust-lang.org/nightly/std/mem/trait.TransmuteFrom.html

pub unsafe trait TransmuteFrom<Src, const ASSUME: Assume = { Assume::NOTHING }> where Src: ?Sized {}

I expected to see this happen: Renders identically to the above in the rustdoc output.

Instead, this happened: Renders as

pub unsafe trait TransmuteFrom<Src, const ASSUME: Assume = core::::mem::transmutability::TransmuteFrom::{constant#0}> where Src: ?Sized {}

Meta

rustc --version:

1.85.0-nightly (c44b3d50f 2024-12-03)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)A-cross-crate-reexportsArea: Documentation that has been re-exported from a different crateC-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions