diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2025-02-05 05:03:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-05 05:03:04 +0100 |
| commit | 9830837ab34172aa503f3d63eea4271559e48187 (patch) | |
| tree | 8f71123a882ae9d1447efb0ae075d322b0693692 /compiler/rustc_codegen_llvm/src/llvm_util.rs | |
| parent | 75989e98d8b5e9d7e741732aee058c49864c9c52 (diff) | |
| parent | 53b8de1c9a9f027c9d2effc5eeed2fc99cf7068d (diff) | |
| download | rust-9830837ab34172aa503f3d63eea4271559e48187.tar.gz rust-9830837ab34172aa503f3d63eea4271559e48187.zip | |
Rollup merge of #136392 - jieyouxu:wrap-tracing, r=onur-ozkan
bootstrap: add wrapper macros for `feature = "tracing"`-gated `tracing` macros
Follow-up to https://github.com/rust-lang/rust/pull/136091#discussion_r1930219425.
- Add wrapper macros for `error!`, `warn!`, `info!`, `debug!` and `trace!`, which `cfg(feature = "tracing")`-gates the underlying `tracing` macros. They expand to nothing if `"tracing"` feature is not enabled.
- This is not done for `span!` or `event!` because they can return span guards, and you can't really wrap that.
- This is also not possible for `tracing::instrument` attribute proc-macro unless you use another attribute proc-macro to wrap that.
It's not *great*, because `tracing::instrument` and `tracing::{span,event}` can't be wrapped this way.
Can test locally with:
```bash
$ BOOTSTRAP_TRACING=bootstrap=TRACE ./x check src/bootstrap/
```
r? ``@onur-ozkan`` (or reroll)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
0 files changed, 0 insertions, 0 deletions
