Skip to content

could not find linkme in the list of imported crates #108

Closed
@PonasKovas

Description

@PonasKovas

Hello, thanks for another great crate!

I am trying to wrap this functionality in my own crate, but I am getting this error when trying to use it:

error[E0433]: failed to resolve: could not find `linkme` in the list of imported crates

This is because here I use my own "wrapper" crate and don't import linkme directly. I don't want to burden my users with importing internal crates like this.

I assume this happens because your macro needs to access linkme::DistributedSlice type to construct it.

Would you mind adding an option to give the path to the linkme crate in the macro invocation to solve this issue?

I think something like this would work well:

#[distributed_slice(@my::reexported::path::to::linkme)]
pub static BENCHMARKS: [fn(&mut Bencher)];
#[distributed_slice(@my::reexported::path::to::linkme, BENCHMARKS)]
fn bench_deserialize(b: &mut Bencher) {}

Basically adding an optional argument that starts with @ in the distributed_slice macro to give a path to linkme.

If this is fine to you, I will make a PR.

Wishing you a blessed Christmas and a joyful New Year, filled with the peace and love of Christ.

Edit: if anyone stumbles upon this with the same problem in the future, I actually found that this is already implemented. Lol. Don't tell dtolnay though, as he appears to not be a big fan of the idea.

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