You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both `tracing::*` macros and the `tracing::instrument` proc-macro attribute need to be gated behind `tracing` feature. Examples:
@@ -121,6 +129,14 @@ For `#[instrument]`, it's recommended to:
121
129
- Explicitly pick an instrumentation name via `name = ".."` to distinguish between e.g. `run` of different steps.
122
130
- Take care to not cause diverging behavior via tracing, e.g. building extra things only when tracing infra is enabled.
123
131
132
+
### Profiling bootstrap
133
+
134
+
You can use the `COMMAND` tracing target to trace execution of most commands spawned by bootstrap. If you also use the `BOOTSTRAP_PROFILE=1` environment variable, bootstrap will generate a Chrome JSON trace file, which can be visualized in Chrome's `chrome://tracing` page or on https://ui.perfetto.dev.
Unfortunately, because bootstrap is a `rust-analyzer.linkedProjects`, you can't ask r-a to check/build bootstrap itself with `tracing` feature enabled to get relevant completions, due to lack of support as described in <https://github.com/rust-lang/rust-analyzer/issues/8521>.
Copy file name to clipboardExpand all lines: src/diagnostics.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -601,8 +601,8 @@ The trait implementation allows you to check certain syntactic constructs
601
601
as the linter walks the AST. You can then choose to emit lints in a
602
602
very similar way to compile errors.
603
603
604
-
You also declare the metadata of a particular lint via the `declare_lint!`
605
-
macro. [This macro](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/macro.declare_lint.html) includes the name, the default level, a short description, and some
604
+
You also declare the metadata of a particular lint via the [`declare_lint!`]
605
+
macro. This macro includes the name, the default level, a short description, and some
606
606
more details.
607
607
608
608
Note that the lint and the lint pass must be registered with the compiler.
0 commit comments