Inconvenience of using functions defined in traits, an ugly workaround, and proposed solution

Yes. I think I personally would prefer some sort of “opt-in”, but I have to think about it.

Personally, I’d prefer it if it were in some way connected to the impl of the type itself, because that’s where I go to in the code to look at the interface.

impl Type {
    // syntactically different from normal use statements,
    // because impl might get import statements
    use impl Trait;
}

or

impl Type: impl Trait { }
impl Type: impl Trait { }

With multiple impl Type {} blocks this syntax seems like it could be confusing. I do agree that it makes more sense to be specifying this somewhere in the impl Type block rather than the impl Trait for Type block though.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.