Skip to content

Record field is corrupted when passing from fn(x<int>) to fn(x<T>) #1112

Closed
@mbrubeck

Description

@mbrubeck

The following program fails:

type x<T> = { a: T, b: bool, c: bool };

fn main() {
    let x: x<int> = { a: 3, b: false, c: true };
    foo(x);
}

fn foo(x: x<int>) {
    assert x.c; // passes
    bar(x)
}

fn bar<T>(x: x<T>) {
    assert x.c; // fails
}

This is a minimal test case based on a failure I found when trying to modify code called by std::test::run_tests_console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions