darfink / detour-rs

A cross-platform detour library written in Rust
Other
406 stars 75 forks source link

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

Open Hpmason opened 2 years ago

Hpmason commented 2 years ago

Rust nightly-1.67.0 changes the Fn family of traits, requiring Tuple trait bounds on Fn::Args (https://github.com/rust-lang/rust/pull/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\github.com-1ecc6299db9ec823\detour-0.8.1\src\detours\statik.rs:106:8 | 106 | D: Fn + Send + 'static, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `::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: FnMut { | ^^^^^ required by this bound in `Fn` help: consider further restricting the associated type | 106 | D: Fn + Send + 'static, ::Arguments: Tuple | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0059]: type parameter to bare `Fn` trait must be a tuple --> C:\Users\hpmas\.cargo\registry\src\github.com-1ecc6299db9ec823\detour-0.8.1\src\detours\statik.rs:157:8 | 157 | C: Fn + Send + 'static, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `::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: FnMut { | ^^^^^ required by this bound in `Fn` help: consider further restricting the associated type | 157 | C: Fn + Send + 'static, ::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.