Skip to content

Old generic bounds don't fulfill where clause bounds in trait impls #20112

@sfackler

Description

@sfackler
trait T {
    fn foo<U>() -> U where U: Clone;
}

struct Foo;

impl T for Foo {
    fn foo<U: Clone>() -> U { panic!() }
}

fn main() {}
test.rs:8:5: 8:41 error: in method `foo`, type parameter 0 requires bound `core::clone::Clone`, which is not required by the corresponding type parameter in the trait declaration [E0052]
test.rs:8     fn foo<U: Clone>() -> U { panic!() }
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

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