Skip to content

leak check for param-env projection candidates #85

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

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

leak check for param-env projection candidates #85

lcnr opened this issue Jan 23, 2024 · 1 comment

Comments

@lcnr
Copy link
Contributor

lcnr commented Jan 23, 2024


in the old solver satisfies_trait_bound compiles while satisfies_projection_bound does not.

trait Trait<'a, 'b> {
    type Assoc;
}

trait TraitBound<'b> {}
impl<'b, T: for<'a> Trait<'a, 'b>> TraitBound<'b> for T {}

trait ProjectionBound<'b> {}
impl<'b, T: for<'a> Trait<'a, 'b, Assoc = usize>> ProjectionBound<'b> for T {}

impl<'a, T> Trait<'a, 'static> for T {
    type Assoc = usize;
}

fn trait_bound<'b, T: TraitBound<'b>>() {}
fn projection_bound<'b, T: ProjectionBound<'b>>() {}

fn satisfies_trait_bound<T: for<'b> Trait<'static, 'b>>() {
    trait_bound::<T>()
}

fn satisfies_projection_bound<T: for<'b> Trait<'static, 'b, Assoc = usize>>() {
    projection_bound::<T>()
}

fn main() {}
@lcnr
Copy link
Contributor Author

lcnr commented Mar 14, 2024

can be closed. The behavior is now the same for the old and the new solver once rust-lang/rust#119820 has been merged

@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