We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#[test] fn trait_parameter() { test! { program { #[non_enumerable] trait Trait<T> { type Assoc; } struct Foo {} struct Bar {} impl Trait<()> for Foo { type Assoc = Bar; } } goal { exists<T, U> { <Foo as Trait<T>>::Assoc = U } } yields { expect![[r#"Unique; substitution [?0 := 0<[]>, ?1 := Bar<[]>]"#]] } } }
fails with
program { #[non_enumerable] trait Trait<T> { type Assoc; } struct Foo {} struct Bar {} impl Trait<()> for Foo { type Assoc = Bar; } } ---------------------------------------------------------------------- goal { exists<T, U> { <Foo as Trait<T>>::Assoc = U } } using solver: SLG { max_size: 10, expected_answers: None } ---------------------------------------------------------------------- goal { exists<T, U> { <Foo as Trait<T>>::Assoc = U } } using solver: Recursive { overflow_depth: 100, caching_enabled: true, max_size: 30 } comparing solvers: expected: SLG { max_size: 10, expected_answers: None } actual: Recursive { overflow_depth: 100, caching_enabled: true, max_size: 30 } expected: Ambiguous; no inference guidance actual: Ambiguous; no inference guidance
The text was updated successfully, but these errors were encountered:
You could have a downstream crate with struct Local; impl Trait<Local> for Foo { .. }.
struct Local; impl Trait<Local> for Foo { .. }
Then, () and Local don't unify and its ambiguous.
This should give guidance, though.
Sorry, something went wrong.
Oh, I see. Thanks for the answer. I'll try investigating in that way
No branches or pull requests
fails with
The text was updated successfully, but these errors were encountered: