Skip to content

Commit af31313

Browse files
Adjustments
1 parent 5f778be commit af31313

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

posts/2022-04-07-Rust-1.60.0.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,25 @@ the beta channel (`rustup default beta`) or the nightly channel (`rustup default
2525

2626
## What's in 1.60.0 stable
2727

28-
### Instrumentation-based Code Coverage
28+
### Source-based Code Coverage
2929

30-
Support for LLVM-based coverage instrumentation has been stabilized in rustc, enabled with `-C instrument-coverage`. You can try this out on your code by rebuilding your code with `-Cinstrument-coverage`:
30+
Support for LLVM-based coverage instrumentation has been stabilized in rustc. You can try this out on your code by rebuilding your code with `-Cinstrument-coverage`, for example like this:
3131

3232
```shell=
3333
RUSTFLAGS="-C instrument-coverage" cargo build
3434
```
3535

36-
After that, you can run the resulting binary, which will produce
37-
a `default.profraw` file in the current directory. That can be consumed
38-
by the `llvm-cov` binary shipped with rustc as part of the llvm-tools-preview
39-
component.
36+
After that, you can run the resulting binary, which will produce a
37+
`default.profraw` file in the current directory. (The path and filename can be
38+
overriden by an environment variable; see
39+
[documentation](https://doc.rust-lang.org/stable/rustc/instrument-coverage.html#running-the-instrumented-binary-to-generate-raw-coverage-profiling-data)
40+
for details).
41+
42+
The `llvm-tools-preview` component includes `llvm-profdata` for processing and
43+
merging raw profile output (coverage region execution counts); and `llvm-cov`
44+
for report generation. `llvm-cov` combines the processed output, from
45+
`llvm-profdata`, and the binary itself, because the binary embeds a mapping from
46+
counters to actual source code regions.
4047

4148
```shell=
4249
rustup component add llvm-tools-preview
@@ -55,7 +62,13 @@ The above commands on a simple helloworld binary produce this annotated report,
5562
3| 1|}
5663
```
5764

58-
For more details, please read the [documentation](https://doc.rust-lang.org/rustc/instrument-coverage.html) in the rustc book. The specific output format and LLVM tooling to consume it are both not guaranteed to exist in this specific form, but the baseline functionality will continue to exist for future Rust releases.
65+
For more details, please read the
66+
[documentation](https://doc.rust-lang.org/rustc/instrument-coverage.html) in the
67+
rustc book. While the specific output format and LLVM tooling which produces it
68+
are subject to change, the baseline functionality is stable and will exist in
69+
some form in all future Rust releases. For this reason, it is important to make
70+
sure that you use the same version for both the `llvm-tools-preview` and the
71+
rustc binary used to compile your code.
5972

6073
### `cargo --timings`
6174

@@ -87,7 +100,7 @@ parallel = ["jpeg-decoder/rayon"]
87100
```
88101

89102
There are two things to note in this example:
90-
* The optional dependency `jpeg-decoder` implicitly defines a feature of the same name. Enabling the `jpeg-decoder` feature will enable the `jpeg-decoder` dependency.
103+
* The optional dependency `jpeg-decoder` implicitly defines a feature of the same name. Enabling the `jpeg-decoder` feature will enable the `jpeg-decoder` dependency.
91104
* The `"jpeg-decoder/rayon"` syntax enables the `jpeg-decoder` dependency *and* enables the `jpeg-decoder` dependency's `rayon` feature.
92105

93106
Namespaced features tackles the first issue. You can now use the `dep:` prefix in the `[features]` table to explicitly refer to an optional dependency without implicitly exposing it as a feature. This gives you more control on how to define the feature corresponding to the optional dependency including hiding optional dependencies behind more descriptive feature names.
@@ -109,7 +122,7 @@ In this example, enabling the serde feature will enable the serde dependency. It
109122

110123
### Incremental compilation status
111124

112-
Incremental compilation is re-enabled for the 1.60 release. The Rust team continues to work on fixing bugs in incremental, but no problems causing widespread breakage are known at this time, so we have chosen to reenable incremental compilation. Additionally, the compiler team is continuing to work on long-term strategy to avoid future problems of this kind. That process is in relatively early days, so we don't have anything to share yet on that front.
125+
Incremental compilation is re-enabled for the 1.60 release. The Rust team continues to work on fixing bugs in incremental, but no problems causing widespread breakage are known at this time, so we have chosen to reenable incremental compilation. Additionally, the compiler team is continuing to work on long-term strategy to avoid future problems of this kind. That process is in relatively early days, so we don't have anything to share yet on that front.
113126

114127
### Stabilized APIs
115128

0 commit comments

Comments
 (0)