Skip to content

Commit 7bf026e

Browse files
committed
Doc: unstable book - profile.md: improve wording
- mention `--target` flag excludes RUSTFLAGS passing to build scripts and proc macros
1 parent 2b26b8b commit 7bf026e

File tree

1 file changed

+4
-3
lines changed
  • src/doc/unstable-book/src/compiler-flags

1 file changed

+4
-3
lines changed

src/doc/unstable-book/src/compiler-flags/profile.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cargo run
2121
Once you've built and run your program, files with the `gcno` (after build) and `gcda` (after execution) extensions will be created.
2222
You can parse them with [llvm-cov gcov](https://llvm.org/docs/CommandGuide/llvm-cov.html#llvm-cov-gcov) or [grcov](https://github.com/mozilla/grcov).
2323

24-
Please note that `RUSTFLAGS` apply to everything that cargo builds and runs during a build, including build scripts!
25-
To avoid this, pass a `RUSTC_WRAPPER` program to cargo that only adds the profiling flags to rustc for the specific
26-
crates you want to profile.
24+
Please note that `RUSTFLAGS` by default applies to everything that cargo builds and runs during a build!
25+
When the `--target` flag is explicitly passed to cargo, the `RUSTFLAGS` no longer apply to build scripts and procedural macros.
26+
For more fine-grained control consider passing a `RUSTC_WRAPPER` program to cargo that only adds the profiling flags to
27+
rustc for the specific crates you want to profile.

0 commit comments

Comments
 (0)