Skip to content

No check for infinitely sized structs #3779

Closed
@nikomatsakis

Description

@nikomatsakis

The following program causes a stack overflow:

struct S {
    element: Option<S>
}

fn main() {
}

There is a check that enums do not recurse in this way, but no such check for structs. (Note, though, that there is a check that structrs are instantiable, which is slightly different)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationP-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions