Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
sfackler opened this issue Dec 21, 2014 · 1 comment
Closed

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

sfackler opened this issue Dec 21, 2014 · 1 comment

Comments

@sfackler
Copy link
Member

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
@sfackler
Copy link
Member Author

Dup of #20107

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant