dtolnay / dtolnay/linkme

Ability to use `linkme` in proc macros without requiring explicit dependency

Open
#110 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
890
Forks
46
PR merge metrics
No merged PRs in 30d

Description

I have a procedural macro that outputs code with `linkme`, the problem is that it requires users of the macro to know about this and add `linkme` to explicit dependencies.

I'm wondering if it would be possible to add support for custom `linkme` path (rather than `::linkme`) so I can customize it to point to re-exports.

Something like this:
```rust
#[distributed_slice(BENCHMARKS, linkme = "::other_crate::__private::linkme")]
```

This would be a big UX improvement for users of my crate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the distributed_slice procedural macro handles the generated ::linkme path and how attribute arguments are parsed. The issue's example shows the intended configurable path; done means callers can supply a re-export path so users do not need an explicit linkme dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.