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

Tests are not building #77

Closed
0nkery opened this issue Jun 17, 2016 · 4 comments
Closed

Tests are not building #77

0nkery opened this issue Jun 17, 2016 · 4 comments

Comments

@0nkery
Copy link
Contributor

@0nkery 0nkery commented Jun 17, 2016

Trying to run tests with nightly rustc 1.11.0-nightly (bb4a79b08 2016-06-15).

tests/test.rs:405:68: 405:68 error: mismatched types [E0308]
tests/test.rs:405     #[derive(RustcEncodable, RustcDecodable, Serialize, Deserialize, Debug)]
                                                                                     ^
tests/test.rs:405:57: 405:68 note: in this expansion of try! (defined in <std macros>)
tests/test.rs:405:57: 405:68 note: in this expansion of #[derive_Deserialize] (defined in tests/test.rs)
tests/test.rs:405:68: 405:68 help: run `rustc --explain E0308` to see a detailed explanation
tests/test.rs:405:68: 405:68 note: expected type `serde::Deserialize`
tests/test.rs:405:68: 405:68 note:    found type `serde::Deserialize`
tests/test.rs:405:57: 405:68 note: the lifetime 'a as defined on the block at 405:56...
tests/test.rs:405     #[derive(RustcEncodable, RustcDecodable, Serialize, Deserialize, Debug)]
                                                                          ^~~~~~~~~~~
tests/test.rs:405:68: 405:68 note: ...does not necessarily outlive the static lifetime

As far as I can tell this error points RefBox's lifetimes.

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented Jun 19, 2016

@0nkery @dtolnay @erickt: could this be a change in the Deserialize codegen? Could one of the serde maintainers tell us if there were any changes to codegen that would break us like this?

@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented Jun 19, 2016

Until this is figured out, I'll be disabling the tests over in #78

@dtolnay
Copy link
Collaborator

@dtolnay dtolnay commented Jun 19, 2016

So far I have narrowed it down to the following code does not compile:

#[derive(Deserialize)]
struct Message<'a>(RefBox<'a, ()>);

Now I will start looking at the generated code to find the problem.

@dtolnay
Copy link
Collaborator

@dtolnay dtolnay commented Jun 19, 2016

This failure was correct on Serde's part and a bug in bincode. The code was trying to derive Deserialize for a type containing RefBox<'a, _>, but that does not implement Deserialize because only RefBox<'static, _> implements Deserialize. I have a fix in #79.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.