E4206#
Compiler diagnostic name: must_implement_one.
The #must_implement_one trait attribute requires each implementation to
provide at least one method from the specified set. If the implementation relies
only on defaults for all required methods, the compiler reports this error.
Erroneous example#
///|
type Token
///|
#must_implement_one(render)
pub(open) trait Render {
render(Self) -> String = _
debug(Self) -> String = _
}
///|
impl Render with render(_) {
"rendered"
}
///|
impl Render with debug(_) {
"debug"
}
///|
pub impl Render for Token with debug(_) {
"token"
}
Suggestion#
Implement at least one of the methods named by #must_implement_one.
///|
type Token
///|
#must_implement_one(render)
pub(open) trait Render {
render(Self) -> String = _
debug(Self) -> String = _
}
///|
impl Render with render(_) {
"rendered"
}
///|
impl Render with debug(_) {
"debug"
}
///|
pub impl Render for Token with render(_) {
"token"
}