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

Unsupported closure + dyn #666

Closed
ranjitjhala opened this issue Jul 25, 2024 · 1 comment
Closed

Unsupported closure + dyn #666

ranjitjhala opened this issue Jul 25, 2024 · 1 comment

Comments

@ranjitjhala
Copy link
Contributor

Via @enjhnsn2

I found a minimized example that triggers the error. Unfortunately its a little more complicated:

pub trait Animal {
    fn noise(&self);
}

fn apply_closure_to_animal<F>(closure: F, animal: &'static dyn Animal)
where
    F: FnOnce(&dyn Animal),
{
    closure(animal);
}

This bug isn't too frequent and is possible to work around, so I don't think you should block this pr on it.

Originally posted by @enjhnsn2 in #664 (comment)

@ranjitjhala
Copy link
Contributor Author

ranjitjhala commented Aug 6, 2024

Seems to work now -- I think fixed by #664 see this test, so closing ping @enjhnsn2

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