Closed CinchBlue closed 1 year ago
$ cargo --version
cargo 1.66.0-nightly (f5fed93ba 2022-09-27)
I have just created a PR for a fix. Essentially it seems we want something like $crate
in the procedural macro, but I don't know spans well enough to mutate the current implementation to use it. So this should be a nice to still allow ::metrics
to be used even if some use foo::metrics
is imported.
I can also confirm that this fixes my compilation issue locally if I use the PR branch with my workspace:
[workspace.dependencies]
metrics = { git = "https://github.com/CinchBlue/metrics", branch = "refactor/metrics-macros/global-paths" }
Not sure if this is just a nightly compiler bug, but here's what I see:
I am trying to use the macros like so:
this results in a compilation error. with
RUSTFLAGS='-Z macro-backtrace' cargo build
on my workspace:Maybe a macro scoping issue? Not exactly sure what's going on. But it's preventing me from using
metrics
in my crate right now.