-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
Description
pub struct Struct;
pub trait Trait {
const REQUIRED: Struct;
const OPTIONAL: Struct = Struct {};
}
impl Trait for Struct {
const REQUIRED: Struct = Struct {};
const OPTIONAL: Struct = Struct {};
}
impl Struct {
pub const INHERENT: Struct = Struct {};
}
In the trait's documentation, rustdoc renders const REQUIRED: Struct;
and const OPTIONAL: Struct = _;
. Here the = _
is meaningful because it signals that a trait's associated constant has some default value provided by the trait, even if that default value cannot be rendered.
But in the struct's documentation, none of the 3 = _
are meaningful. All three are just noise and should be omitted.
fmease
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)C-bugCategory: This is a bug.Category: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.