Skip to content

Rustdoc displays private internals of associated constants (regression) #97933

Closed
@dtolnay

Description

@dtolnay
pub struct Struct {
    private: (),
}

impl Struct {
    pub const CONST: Self = Struct { private: () };
}

Correct:


Incorrect:


I used the following script to bisect:

#!/bin/bash
cargo doc && ! rg private: $CARGO_TARGET_DIR/doc/repro/struct.Struct.html >/dev/null
cargo-bisect-rustc --script ./bisect.sh

It bisects to nightly-2022-04-14 and specifically #95990, of which #95316 seems the most relevant because it involves associated constants in rustdoc. @fmease @notriddle @GuillaumeGomez

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions