Skip to content

Calling tuple struct constructor as a function causes segfault #5315

Closed
@lifthrasiir

Description

@lifthrasiir

This code segfaults (as of a5fae1d 2013-03-08 18:15:40 -0800).

struct A(int);
fn main() {
    let f: extern pure fn(int) -> A = A; f(4);
}

Note that extern pure fn(int) -> A is an exact type reported by the compiler for A. This occurs for arbitrary number of fields. Replacing the body of main to A(4); fixes the segfault.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions