Closed
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.