-
Notifications
You must be signed in to change notification settings - Fork 70
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
Mock for Function returning !
fails to compile
#624
Comments
As you've figured out by now, Mockall needs to generate a lot of code for every mocked function. Just because stable Rust allows something in an |
I was hoping there might be a way to special-case this or have an approach that may work on stable. From browsing the issues on this repo, it seems like there are users that are trying to use this crate to mock ffi functions. With that in mind, and that it looks like many are using bindgen, would it be possible to extend the |
No, I'm afraid. I don't want to add any new syntax until #539 is complete. |
I have a bindgen generated ffi function that returns
!
. This is allowed on stable rust. The code thatautomock
generates fails to compile for stable rust.Code Example:
Error:
The
error[E0658]: the `!` type is experimental
error is actually coming from the macro-generated code, not the original ffi declaration:Expanded macro
Some situations in which supporting mocks for never returning functions would be useful include:
The text was updated successfully, but these errors were encountered: