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

use of inner type within custom deserialization logic stack overflows at compilation #1596

Closed
Dowwie opened this issue Aug 9, 2019 · 2 comments

Comments

@Dowwie
Copy link

Dowwie commented Aug 9, 2019

This is a problem where something that worked fine for a very long time no longer works: the use of an inner Deserializable type within custom Deserialization logic

https://play.integer32.com/?version=stable&mode=debug&edition=2018&gist=0d5d637f9cc699a1e1d22d020541f934

I've used the InnerSettings type (L19) with success for a long time and only now is it stack overflowing at compile time. Moving InnerSettings out of the custom deserialization logic solves the issue. Therefore, it seems that something changed in a recent version of serde/derive. Would someone please confirm?

Additionally, I've tried this on macos laptop and it compiles w/rustc 1.36 stable. It fails to compile on debian and on the playground.

If you were to run these as a package: https://gist.github.com/Dowwie/3483499835880f7f943d911e6354be0d

Thanks!

-Darin

@dtolnay
Copy link
Member

dtolnay commented Aug 9, 2019

This is a compiler bug, not something that changed in serde -- rust-lang/rust#55779. As a workaround it should work if you put extern crate serde in the crate root.

@Dowwie
Copy link
Author

Dowwie commented Aug 9, 2019

@dtolnay correct! that worked. thank you!

@Dowwie Dowwie closed this as completed Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants