dtolnay / linkme

Safe cross-platform linker shenanigans
Apache License 2.0
626 stars 42 forks source link

Document follow-up attributes #54

Open djmitche opened 2 years ago

djmitche commented 2 years ago

It seems like

#[distributed_slice(FOO)]
#[linkme(crate=::mycrate::linkme)]
static BENCH_DESERIALIZE: fn(&mut Bencher) = bench_deserialize;

causes distributed_slice to refer to the linkme crate as ::mycrate::linkme. But, I don't see this documented anywhere. I don't quite understand it well enough to write those docs myself :)

jcrevier commented 8 months ago

Would definitely appreciate this being documented -- I spent a bit of time trying to find another solution before finding it. My use case was to to wrap linkme declarations with my own macro_rules macro to simplify this for users of an API and to do that you do need to re-write the paths -- I suspect this is a fairly common pattern.