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 while using serde #72024

Closed
euclio opened this issue May 8, 2020 · 1 comment
Closed

rustc stack overflow while using serde #72024

euclio opened this issue May 8, 2020 · 1 comment
Labels
C-bug Category: This is a bug.

Comments

@euclio
Copy link
Contributor

euclio commented May 8, 2020

I tried this code:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=56914d5ac20726d98a92eb173281eb09

use serde::{Deserialize, Deserializer};

pub enum Message {}

impl<'de> Deserialize<'de> for Message {
    fn deserialize<D>(_deserializer: D) -> Result<Self, D::Error>
    where
        D: Deserializer<'de>,
    {
        #[derive(Deserialize)]
        pub struct RawMessage {}
    }
}

I expected to see this happen: Get a type error. This is reduced from a much larger example.

Instead, this happened: rustc overflows its stack.

Meta

rustc --version --verbose:

rustc 1.43.1 (8d69840ab 2020-05-04)
binary: rustc
commit-hash: 8d69840ab92ea7f4d323420088dd8c9775f180cd
commit-date: 2020-05-04
host: x86_64-unknown-linux-gnu
release: 1.43.1
LLVM version: 9.0

This bug is also present on nightly.

Backtrace

None.

@euclio euclio added the C-bug Category: This is a bug. label May 8, 2020
@euclio
Copy link
Contributor Author

euclio commented May 8, 2020

Actually this looks like a dupe of #55779.

@euclio euclio closed this as completed May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

1 participant