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

rustc stack overflow when invoking Serialize_tuple or Deserialize_tuple #7

Closed
ericseppanen opened this issue Aug 6, 2020 · 1 comment

Comments

@ericseppanen
Copy link

I tried out serde_tuple for the first time, and every time I try to use it I get a rustc stack overflow.

I get this even if I create an empty project with one test and one struct:

#[cfg(test)]
mod tests {
    use serde_tuple::{Serialize_tuple};

    #[test]
    fn basic() {
        #[derive(Serialize_tuple)]
        pub struct Basic {
            name: u32,
        }

        let _x = Basic {
            name: 123
        };
    }
}

I get:

$ cargo check --tests
    Updating crates.io index
   Compiling proc-macro2 v1.0.19
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.38
   Compiling serde_derive v1.0.114
   Compiling serde v1.0.114
   Compiling quote v1.0.7
   Compiling serde_tuple_macros v0.5.0
    Checking serde_tuple v0.5.0
    Checking serde_tuple_playground v0.1.0 (/home/eric/work/rust/serde_tuple_playground)

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `serde_tuple_playground`.

Caused by:
  process didn't exit successfully: `rustc --crate-name serde_tuple_playground --edition=2018 src/lib.rs ...` (signal: 6, SIGABRT: process abort signal)

I tried a few different stable and nightly releases of the compiler; I've tried the last few releases on serde_tuple as well. All fail the same way. This is on Linux x86_64.

@ericseppanen
Copy link
Author

I found the workaround here.

Adding the placeholder code fixes it for me:

#[derive(serde_derive::Deserialize)]
struct Empty {}

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