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

impl SomeType as a parameter on a mocked method does not compile #15

Closed
nrxus opened this issue Jan 7, 2020 · 1 comment
Closed

impl SomeType as a parameter on a mocked method does not compile #15

nrxus opened this issue Jan 7, 2020 · 1 comment

Comments

@nrxus
Copy link
Owner

nrxus commented Jan 7, 2020

Example: if a parameter to a mocked function is &impl serde::Serialize, faux will fail to compile.

The culprit is this line:

let input: (#(#arg_types),*) = unsafe { std::mem::transmute((#(#arg_idents),*)) };

This becomes:

 let input: (&impl serde::Serialize) = unsafe { std::mem::transmute((_x0)) };

There is an issue for using impl on a let binding but I am unsure how the transmute might work with that: rust-lang/rust#63065 🤷‍♂️

@nrxus nrxus changed the title impl SomeType on a mocked method does not compile impl SomeType as a parameter on a mocked method does not compile Jan 7, 2020
@nrxus
Copy link
Owner Author

nrxus commented Jan 14, 2020

The problem with the way the code is expanded is "fixed" in 500e9a9 but impl arguments or any generic argument still does not work. Tracked in #18

@nrxus nrxus closed this as completed Jan 14, 2020
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