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

Fix trait bounds for recent Rust nightly #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

veeenu
Copy link

@veeenu veeenu commented Nov 11, 2022

On recent Rust nightlies, this crate fails to compile with the following error:

error[E0059]: type parameter to bare `Fn` trait must be a tuple
   --> C:\Users\andrea\.cargo\git\checkouts\detour-rs-4ad9facba90b8dd7\b0e6366\src\detours\statik.rs:106:8
    |
106 |     D: Fn<T::Arguments, Output = T::Output> + Send + 'static,
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `<T as Function>::Arguments`
    |
note: required by a bound in `Fn`
help: consider further restricting the associated type
    |
106 |     D: Fn<T::Arguments, Output = T::Output> + Send + 'static, <T as Function>::Arguments: Tuple
    |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0059]: type parameter to bare `Fn` trait must be a tuple
   --> C:\Users\andrea\.cargo\git\checkouts\detour-rs-4ad9facba90b8dd7\b0e6366\src\detours\statik.rs:157:8
    |
157 |     C: Fn<T::Arguments, Output = T::Output> + Send + 'static,
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `<T as Function>::Arguments`
    |
note: required by a bound in `Fn`
help: consider further restricting the associated type
    |
157 |     C: Fn<T::Arguments, Output = T::Output> + Send + 'static, <T as Function>::Arguments: Tuple
For more information about this error, try `rustc --explain E0059`.

This patch addresses this issue.

P.S. I also added a rust-toolchain.toml file as it looks like this crate fails to compile without nightly anyway. Is that desirable?

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

Successfully merging this pull request may close these issues.

2 participants