1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Internal log-macro shim. Crate-private — never re-exported.
//!
//! When the `tracing` feature is on, `crate::log::{debug, error, info,
//! trace, warn}` re-export the corresponding `tracing::*` macros
//! verbatim. When off (`bare_metal`-without-`std` builds, where the
//! `tracing-core` `extern crate alloc` declaration would fail against
//! a `core`-only sysroot), the names resolve to a single token-eating
//! macro that wraps `core::format_args!` in an `if false { … }` block:
//! references in the format string still count as variable uses for
//! the borrow checker (no spurious `unused_variables` lints in callers
//! that only consume a binding inside a log call), and the dead block
//! optimizes out, so no log code reaches the linker.
// `unused_imports` because rustc only counts a macro re-export as used
// when it appears in a `use crate::log::name` path; bare-macro
// invocations (`crate::log::name!(…)`) are resolved through the macro
// table rather than the item table and don't satisfy the lint. Three
// of these (debug/error/info) happen not to appear in any `use`-list
// today, so they trip an unused-import warning that doesn't reflect
// reality. Suppress here rather than restructure the call sites.
pub use ;
// `unused_imports` for the same macro-table reason as the `tracing`
// branch above, plus: with `--no-default-features` (no client/server)
// every call site is compiled out, so all five aliases count as
// unused.
pub use noop as debug;
pub use noop as error;
pub use noop as info;
pub use noop as trace;
pub use noop as warn;