Skip to content

Error Building on nightly-1.67.0 - Tuple trait bounds on Args for Fn-Family of traits #39

@Hpmason

Description

@Hpmason

Rust nightly-1.67.0 changes the Fn family of traits, requiring Tuple trait bounds on Fn::Args (rust-lang/rust#99943)

So now when using detour, the following error comes up:

Error
Checking detour v0.8.1
error[E0059]: type parameter to bare `Fn` trait must be a tuple
   --> C:\Users\hpmas\.cargo\registry\src\gitproxy.zycloud.tk-1ecc6299db9ec823\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\hpmas\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ops\function.rs:159:20
    |
159 | 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
    |                                                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0059]: type parameter to bare `Fn` trait must be a tuple
   --> C:\Users\hpmas\.cargo\registry\src\gitproxy.zycloud.tk-1ecc6299db9ec823\detour-0.8.1\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`
   --> C:\Users\hpmas\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\ops\function.rs:159:20
    |
159 | pub trait Fn<Args: Tuple>: FnMut<Args> {
    |                    ^^^^^ required by this 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`.
error: could not compile `detour` due to 2 previous errors

I assume just the trait definition of Function needs to be updated. I know this repo hasn't had any activity in a while, but I saw some forks make commits to fix this. If there are any contributors still around that could look at PRs, I don't mind making the changes myself and creating a PR to fix this. Otherwise, maybe one of the other forks could make a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions