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

using impls with higher ranked projections not normalizeable before matching the impl header #7

Closed
lcnr opened this issue Feb 17, 2023 · 1 comment

Comments

@lcnr
Copy link
Owner

lcnr commented Feb 17, 2023

trait Trait {}

trait OtherTrait {
    type Assoc<'a>;
}

impl<T: OtherTrait> Trait for (T, for<'a> fn(<T as OtherTrait>::Assoc<'a>)) {}

impl OtherTrait for u32 {
    type Assoc<'a> = &'a u32;
}

fn impls<T: Trait>() {}

fn main() {
    impls::<(u32, for<'a> fn(&'a u32))>();
}

This does not work with the old solver but will compile with the new solver.

This means that rust-lang/rust#105787 will end up being exploitable with the new solver though, so we may want to fix that first 🤷

@lcnr lcnr changed the title allow impls with higher ranked projections only normalizeable while matching the impl header using impls with higher ranked projections only normalizeable while matching the impl header Feb 17, 2023
@lcnr lcnr changed the title using impls with higher ranked projections only normalizeable while matching the impl header using impls with higher ranked projections only normalizeable after matching the impl header Feb 17, 2023
@lcnr lcnr changed the title using impls with higher ranked projections only normalizeable after matching the impl header using impls with higher ranked projections not normalizeable before matching the impl header Feb 17, 2023
@lcnr
Copy link
Owner Author

lcnr commented Apr 17, 2023

@lcnr lcnr closed this as completed Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant