Skip to content

Self fails to implement current trait in a default method #7323

@huonw

Description

@huonw
trait Foo {
    fn foo(&self) {
        bar(self)
    }
}

fn bar<F: Foo>(_: &F) {}

fn main(){}
dm2.rs:3:8: 3:11 error: failed to find an implementation of trait Foo for Self
dm2.rs:3         bar(self)
                 ^~~

Presumably Self : Foo in a default method on Foo.

(Part of #2794.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions