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

Errors in mock injected code are correctly pointed by compiler #5

Closed
CodeSandwich opened this issue Jun 30, 2017 · 4 comments
Closed

Comments

@CodeSandwich
Copy link
Owner

CodeSandwich commented Jun 30, 2017

Currently when compiler finds an error in mock injected code, it prints a message pointing to the injection annotation:

error[E0106]: missing lifetime specifier
 --> tests/mocking_regular_functions.rs:6:1
  |
6 | #[inject_mocks]
  | ^ expected lifetime parameter
  |
  = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
  = help: consider giving it a 'static lifetime

Expected behavior of compiler is pointing to place, where the error actually occurs.

Blocked until Syn 0.12: dtolnay/syn#178

@CodeSandwich
Copy link
Owner Author

As of writing this Syn on master branch destroys span information. Switching proc-macro2 'unstable' feature, which is supposed to help to some extent makes Syn uncompilable.

@CodeSandwich
Copy link
Owner Author

CodeSandwich commented Aug 15, 2017

Current workaround: before running cargo test try to compile project witch cargo check or cargo build

@CodeSandwich
Copy link
Owner Author

Port to Syn 0.12 almost done, but it can't use proc-macro2's nightly feature, because rust-lang/rust#47627, so still blocked.

@CodeSandwich
Copy link
Owner Author

Fixed in 0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant