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

Doesn't work with explicit lifetimes for &self #95

Closed
asomers opened this issue Dec 18, 2019 · 0 comments · Fixed by #112
Closed

Doesn't work with explicit lifetimes for &self #95

asomers opened this issue Dec 18, 2019 · 0 comments · Fixed by #112
Labels
bug Something isn't working

Comments

@asomers
Copy link
Owner

asomers commented Dec 18, 2019

Attempting to mock a method with an explicit lifetime for the &self argument will result in a panic.

mock!{
    Foo {
        fn foo<'life0>(&'life0 self, x: u32) -> u32;
    }
}

results in

error: proc macro panicked
 --> mockall/tests/mock_life0.rs:5:1
  |
5 | / mock!{
6 | |     Foo {
7 | |         fn foo<'life0>(&'life0 self, x: u32) -> u32;
8 | |     }
9 | | }
  | |_^
  |
  = help: message: An unused lifetime parameter?
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.

1 participant