Skip to content

Static methods in traits #14582

@Monnoroch

Description

@Monnoroch

Is this a bug or a feature?

trait MyTrait {
    fn act();
}

fn act<T:MyTrait>(val: &T) {
    T::act();
}

Gives:

main.rs:19:6: 19:12 error: unresolved name
main.rs:19      T::act();
                ^~~~~~
main.rs:19:6: 19:12 error: use of undeclared module `T`
main.rs:19      T::act();
                ^~~~~~
main.rs:19:6: 19:12 error: unresolved name `T::act`. Did you mean `val`?
main.rs:19      T::act();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions