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 compiling on nightly #45

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

Fix compiling on nightly #45

wants to merge 2 commits into from

Conversation

kerosina
Copy link

@kerosina kerosina commented Oct 18, 2024

In nightly, the compiler complains about:

error[E0059]: type parameter to bare `Fn` trait must be a tuple
   --> C:\Users\[redacted]\.cargo\registry\src\index.crates.io-6f17d22bba15001f\detour-0.8.1\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`
   --> C:\Users\[redacted]\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ops\function.rs:76:20
    |
76  | pub trait Fn<Args: Tuple>: FnMut<Args> {
    |                    ^^^^^ required by this 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
    |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The rust core lib's Fn trait was updated to constrain Args to have the Tuple trait.
This PR follows the suggestions of the compiler and fixes the issue by adding a bound to T::Arguments where it must also have Tuple.

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.

1 participant