You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0308]: mismatched types
--> crates\core\src\lib.rs:21:5
|
21 | / static_detours! {
22 | | pub struct DetourPrintln: fn(&str);
23 | | }
| |_____^ one type is more general than the other
|
= note: expected type `detour::Function`
found type `detour::Function`
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
The text was updated successfully, but these errors were encountered:
That's correct.
The Function trait cannot express lifetime semantics of individual arguments and has therefore a 'static requirement (so functions with reference arguments do not implement it).
An alternative is to use the more cumbersome RawDetour.
Perhaps there is a potentially better alternative implementation but I've yet to identify a solution that is type-safe.
Something goes wrong deep in the innards of the macro when you try to detour an extern "Rust" function that takes a reference as a parameter:
The text was updated successfully, but these errors were encountered: