Skip to content

Stack overflow in rustc_middle::ty::print::pretty::PrettyPrinter::pretty_print_type #71833

Closed
@tadeokondrak

Description

@tadeokondrak

I tried this code:

struct Foo;
impl<'de> serde::Deserialize<'de> for Foo {
    fn deserialize<D: serde::Deserializer<'de>>(_: D) -> Result<Self, D::Error> {
        extern crate serde as _serde;
        struct Bar;
        impl<'de> _serde::Deserialize<'de> for Bar {}
    }
}
fn main() {}

I expected to see this happen:

An error message about how required functions are missing (but this is reduced from a program that should have compiled).

Instead, this happened:

thread 'rustc' has overflowed its stack
fatal runtime error: stack overflow

Meta

rustc --version --verbose:

rustc 1.44.0-nightly (7f3df5772 2020-04-16)
binary: rustc
commit-hash: 7f3df5772439eee1c512ed2eb540beef1124d236
commit-date: 2020-04-16
host: x86_64-unknown-linux-gnu
release: 1.44.0-nightly
LLVM version: 9.0

Backtrace: https://gist.github.com/tadeokondrak/2020c314ad4e1af21ae21e83351e1cb8

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions