Skip to content
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

Type bound regression #88

Closed
DGolubets opened this issue Dec 1, 2019 · 1 comment · Fixed by #89
Closed

Type bound regression #88

DGolubets opened this issue Dec 1, 2019 · 1 comment · Fixed by #89
Labels
bug Something isn't working

Comments

@DGolubets
Copy link

DGolubets commented Dec 1, 2019

This example doesn't work on master (but it did in 0.5.1):

struct X<T: Debug>(T);

#[automock]
trait Foo {
    fn foo<T: Debug + 'static>(&self, x: X<T>);
}

Gives an error:

`T` cannot be formatted using `{:?}` because it doesn't implement `std::fmt::Debug`

However if I move type bounds to where it works:

#[automock]
trait Foo {
    fn foo<T>(&self, x: X<T>)
        where T: Debug + 'static;
}
@asomers asomers added the bug Something isn't working label Dec 1, 2019
@asomers
Copy link
Owner

asomers commented Dec 1, 2019

The bug was introduced by b2d762e

asomers added a commit that referenced this issue Dec 1, 2019
generic struct with type bounds on their struct's generic parameters
that also have generic methods are probably affected.

Fixes #88
asomers added a commit that referenced this issue Dec 2, 2019
generic struct with type bounds on their struct's generic parameters
that also have generic methods are probably affected.

Fixes #88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants