AlexEne / AlexEne/rust_hawktracer_normal_macro

Use fully qualified names in macros

未关闭
#5 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Rust
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

Macro implementations should not be depending on imports done by the caller.

https://github.com/AlexEne/rust_hawktracer_normal_macro/blob/b729096df0d243a203a1e81efd917b9876d4033b/src/lib.rs#L22

A user of `rust_hawktracer` running code with edition 2018 should be able to add a scoped tracepoints simply doing
```rust
rust_hawktracer::scoped_tracepoint!(_something_to_trace)
```

This is currently not possible, so the alternative seems being
* importing all `rust_hawktracer` with the risk of polluting the namespace
* importing the symbols that `scoped_tracepoint` expects (`rust_hawktracer::{add_cached_mapping, scoped_tracepoint, ScopedTracepoint}`).

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。