Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proving WellFormed for struct types #126

Closed
mattheww opened this issue Jun 25, 2023 · 1 comment
Closed

Proving WellFormed for struct types #126

mattheww opened this issue Jun 25, 2023 · 1 comment

Comments

@mattheww
Copy link
Contributor

I've been reading through the current version of a-mir-formality, and I can't find support for proving WellFormed for types other than tuples.

I've tried to test the equivalent of this:

trait SomeTrait {
}

struct InnerThing<T> where T: SomeTrait {
    inner: T
}

struct OuterThing<T> where T: SomeTrait {
    it: InnerThing<T>
}

as follows:

#[test]
fn test_struct_field_well_formed() {
    expect_test::expect![[r#"
        Ok(
            (),
        )
    "#]]
    .assert_debug_eq(&test_program_ok(
        "[
            crate foo {

                trait SomeTrait<> where [] {}

                struct InnerThing<ty T> where [T: SomeTrait<>] {
                  inner: T
                }

                struct OuterThing<ty T> where [T: SomeTrait<>] {
                  it: InnerThing<T>
                }

            },
        ]",
    ));
}

It says failed to prove {@ wf((rigid (adt InnerThing) !ty_1))} given {SomeTrait(!ty_1)}, got {}.

Is this part of a-mir-formality still incomplete, or am I doing something wrong?

@mattheww
Copy link
Contributor Author

The answer to this question was that this part of a-mir-formality was incomplete.

The test above passes now.

See also #146 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant