We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently Mockall can't mock a constructor method for a generic struct that has bounds on its generic parameters. For example:
mock! { pub Foo<T: Default +'static> { fn build<T2: Default + 'static>() -> MockFoo<T2>; } }
produces errors like
error[E0277]: the trait bound `T2: std::default::Default` is not satisfied --> mockall/tests/mock_generic_constructor_2.rs:7:1 | 7 | / mock! { 8 | | pub Foo<T: Default +'static> { 9 | | fn build<T2: Default + 'static>() -> MockFoo<T2>; 10 | | } 11 | | } | |_^ the trait `std::default::Default` is not implemented for `T2` | = help: consider adding a `where T2: std::default::Default` bound
The text was updated successfully, but these errors were encountered:
6cdded6
No branches or pull requests
Currently Mockall can't mock a constructor method for a generic struct that has bounds on its generic parameters. For example:
produces errors like
The text was updated successfully, but these errors were encountered: