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

super trait bounds equal modulo normalization #84

Closed
lcnr opened this issue Jan 18, 2024 · 1 comment
Closed

super trait bounds equal modulo normalization #84

lcnr opened this issue Jan 18, 2024 · 1 comment

Comments

@lcnr
Copy link
Contributor

lcnr commented Jan 18, 2024

// We try to infer `T::Rigid: Into<?0>` and have 2 candidates from where-clauses:
//
// - `Into<String>`
// - `Into<<T::Rigid as Elaborate>::Assoc>`
//
// This causes ambiguity unless we normalize the alias in the second candidate
// to detect that they actually result in the same constraints.
trait Trait {
    type Rigid: Elaborate<Assoc = String> + Into<String> + Default;
}

trait Elaborate: Into<Self::Assoc> {
    type Assoc;
}

fn test<T: Trait>() {
    let rigid: T::Rigid = Default::default();
    drop(rigid.into());
}

fn main() {}

THis test currently results in ambiguity in the new solver.

Strongly related to

@lcnr
Copy link
Contributor Author

lcnr commented Mar 14, 2024

fixed by rust-lang/rust#119106

@lcnr lcnr closed this as completed Mar 14, 2024
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