Can you call a trait static method implemented by types from another trait static method implemented in the trait? For example:
trait SqlTable {
fn table_
SomeTrait::some_method()
._: Option<Self>
and pass it None::<T>
.See original question for code that (as of today) compiles.
You have to change Self to SqlTable:
trait SqlTable {
fn table_name() -> String;
fn load(id: i32) -> Self {
...
SqlTable::table_name() // <-- this is not right
...
}
}
Static methods are always called on a trait like SomeTrait::some_method(). Bug #6894 covers this issue.