Skip to content

How to use slices in get_stabbied? #95

@xxshady

Description

@xxshady

I tried to use stabby::slice::Slice to write the same:

.get_canaried::<extern "C" fn(&[u8])>(b"unstable_fn")

But it failed to compile

error: implementation of `IStable` is not general enough
   --> src/main.rs:165:65
    |
165 |         let exit_fn: extern "C" fn(stabby::slice::Slice<u8>) = *llib.get_stabbied(b"exit").unwrap();
    |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `IStable` is not general enough
    |
    = note: `IStable` would have to be implemented for the type `for<'a> extern "C" fn(Slice<'a, u8>)`
    = note: ...but `IStable` is actually implemented for the type `extern "C" fn(Slice<'0, u8>)`, for some specific lifetime `'0`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions