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
Copy file name to clipboardExpand all lines: posts/2022-04-07-Rust-1.60.0.md
+22-9Lines changed: 22 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -25,18 +25,25 @@ the beta channel (`rustup default beta`) or the nightly channel (`rustup default
25
25
26
26
## What's in 1.60.0 stable
27
27
28
-
### Instrumentation-based Code Coverage
28
+
### Source-based Code Coverage
29
29
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:
31
31
32
32
```shell=
33
33
RUSTFLAGS="-C instrument-coverage" cargo build
34
34
```
35
35
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
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.
40
47
41
48
```shell=
42
49
rustup component add llvm-tools-preview
@@ -55,7 +62,13 @@ The above commands on a simple helloworld binary produce this annotated report,
55
62
3| 1|}
56
63
```
57
64
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
* 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.
91
104
* The `"jpeg-decoder/rayon"` syntax enables the `jpeg-decoder` dependency *and* enables the `jpeg-decoder` dependency's `rayon` feature.
92
105
93
106
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
109
122
110
123
### Incremental compilation status
111
124
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.
0 commit comments