Closed
Description
Code
struct AB {}
impl<'de> serde::Deserialize<'de> for AB {
fn deserialize<D>(_deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
#[derive(serde::Deserialize)] // comment this out to fix the stack overflow
struct A2 {}
return Ok(AB{})
}
}
fn main(){}
playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=8bfc3b0d3b728b256df33a4db645302c
Meta
rustc --version --verbose
:
rustc 1.50.0-beta.5 (ff5998292 2021-01-05)
binary: rustc
commit-hash: ff59982926d98c8508008f0559f8a055260ac05e
commit-date: 2021-01-05
host: x86_64-pc-windows-msvc
release: 1.50.0-beta.5
(but also present in stable and nightly)
Error output
thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow
error: could not compile `playground`