From f15c6eea1a7ff555123e6bfc9510e74e74e08a48 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 18 Mar 2022 17:49:41 -0400 Subject: [PATCH 01/11] Add blog post --- posts/2022-04-07-Rust-1.60.0.md | 172 + static/images/2022-04-07-timing.html | 10116 +++++++++++++++++++++++++ 2 files changed, 10288 insertions(+) create mode 100644 posts/2022-04-07-Rust-1.60.0.md create mode 100644 static/images/2022-04-07-timing.html diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md new file mode 100644 index 000000000..28fdc5a57 --- /dev/null +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -0,0 +1,172 @@ +--- +layout: post +title: "Announcing Rust 1.60.0" +author: The Rust Release Team +release: true +--- + +The Rust team is happy to announce a new version of Rust, 1.60.0. Rust is a programming language empowering everyone to build reliable and efficient software. + +If you have a previous version of Rust installed via rustup, you can get 1.60.0 with: + +```console +rustup update stable +``` + +If you don't have it already, you can [get `rustup`][install] +from the appropriate page on our website, and check out the +[detailed release notes for 1.60.0][notes] on GitHub. +If you'd like to help us out by testing future releases, you might consider updating locally to use +the beta channel (`rustup default beta`) or the nightly channel (`rustup default nightly`). Please [report] any bugs you might come across! + +[install]: https://www.rust-lang.org/install.html +[notes]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1600-2022-04-07 +[report]: https://github.com/rust-lang/rust/issues/new/choose + +## What's in 1.60.0 stable + +### Instrumentation-based Code Coverage + +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`: + +```shell= +RUSTFLAGS="-C instrument-coverage" cargo build +``` + +After that, you can run the resulting binary, which will produce +a `default.profraw` file in the current directory. That can be consumed +by the `llvm-cov` binary shipped with rustc as part of the llvm-tools-preview +component. + +```shell= +rustup component add llvm-tools-preview +$(rustc --print sysroot)/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-profdata merge -sparse default.profraw -o default.profdata +$(rustc --print sysroot)/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov show -Xdemangler=rustfilt target/debug/coverage-testing \ + -instr-profile=default.profdata \ + -show-line-counts-or-regions \ + -show-instantiations +``` + +The above commands on a simple helloworld binary produce this annotated report, showing that each line of the input was covered. + +``` + 1| 1|fn main() { + 2| 1| println!("Hello, world!"); + 3| 1|} +``` + +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. + +### `cargo --timings` + +Cargo has stabilized support for collecting information on build with the `--timings` flag. + +```shell +$ cargo build --timings + Compiling hello-world v0.1.0 (hello-world) + Timing report saved to target/cargo-timings/cargo-timing-20220318T174818Z.html + Finished dev [unoptimized + debuginfo] target(s) in 0.98s +``` + +The report is also copied to `target/cargo-timings/cargo-timing.html`. A report on the release build of Cargo has been put up [here](/images/2022-04-07-timing.html). These reports can be useful for improving build performance. + +### Weak feature dependencies in Cargo + +Cargo has long supported [features](https://doc.rust-lang.org/cargo/reference/resolver.html#features) along with optional dependencies, as illustrated by the snippet below. + +```toml +[dependencies] +jpeg-decoder = { version = "0.1.20", default-features = false, optional = true } + +[features] +# Enables parallel processing support by enabling the "rayon" feature of jpeg-decoder. +parallel = ["jpeg-decoder/rayon"] +``` + +The `"package-name/feature-name"` syntax will also enable package-name if it is an optional dependency. Often this is not what you want, and starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else enables the optional dependency. + +For example, let's say we have added some serialization support to our library, and it requires enabling a corresponding feature in some optional dependencies. That can be done like this: + +```toml +[dependencies] +serde = { version = "1.0.133", optional = true } +rgb = { version = "0.8.25", optional = true } + +[features] +serde = ["dep:serde", "rgb?/serde"] +``` + +In this example, enabling the serde feature will enable the serde dependency. It will also enable the serde feature for the rgb dependency, but only if something else has enabled the rgb dependency. + +### Incremental compilation status + +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. + +### Stabilized APIs + +The following methods and trait implementations are now stabilized: + +- [`Arc::new_cyclic`][arc_new_cyclic] +- [`Rc::new_cyclic`][rc_new_cyclic] +- [`slice::EscapeAscii`][slice_escape_ascii] +- [`<[u8]>::escape_ascii`][slice_u8_escape_ascii] +- [`u8::escape_ascii`][u8_escape_ascii] +- [`Vec::spare_capacity_mut`][vec_spare_capacity_mut] +- [`MaybeUninit::assume_init_drop`][assume_init_drop] +- [`MaybeUninit::assume_init_read`][assume_init_read] +- [`i8::abs_diff`][i8_abs_diff] +- [`i16::abs_diff`][i16_abs_diff] +- [`i32::abs_diff`][i32_abs_diff] +- [`i64::abs_diff`][i64_abs_diff] +- [`i128::abs_diff`][i128_abs_diff] +- [`isize::abs_diff`][isize_abs_diff] +- [`u8::abs_diff`][u8_abs_diff] +- [`u16::abs_diff`][u16_abs_diff] +- [`u32::abs_diff`][u32_abs_diff] +- [`u64::abs_diff`][u64_abs_diff] +- [`u128::abs_diff`][u128_abs_diff] +- [`usize::abs_diff`][usize_abs_diff] +- [`Display for io::ErrorKind`][display_error_kind] +- [`From for ExitCode`][from_u8_exit_code] +- [`Not for !` (the "never" type)][not_never] +- [_Op_`Assign<$t> for Wrapping<$t>`][wrapping_assign_ops] +- [`arch::is_aarch64_feature_detected!`][is_aarch64_feature_detected] + +### Other changes + +There are other changes in the Rust 1.60.0 release. Check out what changed in +[Rust](https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1600-2022-04-07), +[Cargo](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-160-2022-04-07), +and [Clippy](https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-160). + +### Contributors to 1.60.0 + +Many people came together to create Rust 1.60.0. +We couldn't have done it without all of you. +[Thanks!](https://thanks.rust-lang.org/rust/1.60.0/) + +[arc_new_cyclic]: https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#method.new_cyclic +[rc_new_cyclic]: https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#method.new_cyclic +[slice_escape_ascii]: https://doc.rust-lang.org/stable/std/slice/struct.EscapeAscii.html +[slice_u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.escape_ascii +[u8_escape_ascii]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.escape_ascii +[vec_spare_capacity_mut]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.spare_capacity_mut +[assume_init_drop]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_drop +[assume_init_read]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_read +[i8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.abs_diff +[i16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i16.html#method.abs_diff +[i32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i32.html#method.abs_diff +[i64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i64.html#method.abs_diff +[i128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.i128.html#method.abs_diff +[isize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.isize.html#method.abs_diff +[u8_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u8.html#method.abs_diff +[u16_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u16.html#method.abs_diff +[u32_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u32.html#method.abs_diff +[u64_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u64.html#method.abs_diff +[u128_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.u128.html#method.abs_diff +[usize_abs_diff]: https://doc.rust-lang.org/stable/std/primitive.usize.html#method.abs_diff +[display_error_kind]: https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#impl-Display +[from_u8_exit_code]: https://doc.rust-lang.org/stable/std/process/struct.ExitCode.html#impl-From%3Cu8%3E +[not_never]: https://doc.rust-lang.org/stable/std/primitive.never.html#impl-Not +[wrapping_assign_ops]: https://doc.rust-lang.org/stable/std/num/struct.Wrapping.html#trait-implementations +[is_aarch64_feature_detected]: https://doc.rust-lang.org/stable/std/arch/macro.is_aarch64_feature_detected.html diff --git a/static/images/2022-04-07-timing.html b/static/images/2022-04-07-timing.html new file mode 100644 index 000000000..50332b8ae --- /dev/null +++ b/static/images/2022-04-07-timing.html @@ -0,0 +1,10116 @@ + + + + Cargo Build Timings — cargo 0.62.0 + + + + + +

Cargo Build Timings

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Targets:cargo 0.62.0 (lib, bin "cargo")
Profile:release
Fresh units:0
Dirty units:180
Total units:180
Max concurrency:13 (jobs=12 ncpu=12)
Build start:2022-03-18T17:50:29Z
Total time:58.9s
rustc:rustc 1.60.0-beta.4 (99f967e7e 2022-03-14)
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Max (global) rustc threads concurrency:0
+ + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UnitTotalCodegenFeatures
1.cargo v0.62.030.9s25.0s (81%)
2.toml_edit v0.13.428.6s22.3s (78%)default, easy, serde
3.regex-syntax v0.6.189.9s8.1s (82%)default, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
4.clap v3.1.69.2s7.7s (83%)atty, color, default, std, strsim, suggestions, termcolor
5.regex v1.3.98.1s7.3s (90%)aho-corasick, default, memchr, perf, perf-cache, perf-dfa, perf-inline, perf-literal, std, thread_local, unicode, unicode-age, unicode-bool, unicode-case, unicode-gencat, unicode-perl, unicode-script, unicode-segment
6.libnghttp2-sys v0.1.4+1.41.0 build script (run)6.6s
7.libgit2-sys v0.13.2+1.4.2 build script (run)6.3shttps, libssh2-sys, openssl-sys, ssh, ssh_key_from_memory
8.combine v4.6.35.9s0.3s (5%)alloc, bytes, default, std
9.libssh2-sys v0.2.20 build script (run)5.5s
10.globset v0.4.54.5s4.2s (93%)
11.ignore v0.4.164.3s3.8s (88%)
12.openssl v0.10.304.2s2.5s (60%)
13.serde_derive v1.0.1304.1sdefault
14.aho-corasick v0.7.133.9s3.2s (83%)default, std
15.tar v0.4.373.7s3.3s (89%)
16.url v2.2.23.4s3.0s (86%)
17.syn v1.0.763.4s1.9s (56%)clone-impls, default, derive, parsing, printing, proc-macro, quote
18.cargo v0.62.0 bin "cargo"3.1s
19.serde v1.0.1303.0s0.3s (11%)default, derive, serde_derive, std
20.bitmaps v2.1.02.9s0.4s (13%)default, std
21.env_logger v0.9.02.8s2.6s (90%)atty, default, humantime, regex, termcolor
22.git2 v0.14.22.7s1.6s (58%)default, https, openssl-probe, openssl-sys, ssh, ssh_key_from_memory
23.serde_json v1.0.572.3s1.3s (59%)default, raw_value, std
24.crates-io v0.34.02.1s1.7s (82%)
25.cargo-util v0.1.22.1s1.8s (87%)
26.idna v0.2.01.9s1.4s (74%)
27.bstr v0.2.131.8s1.2s (70%)default, lazy_static, regex-automata, std, unicode
28.im-rc v15.0.01.7s0.3s (17%)
29.rand v0.7.31.6s0.8s (50%)alloc, default, getrandom, getrandom_package, libc, std
30.unicode-bidi v0.3.41.6s1.4s (85%)default
31.itertools v0.10.11.6s0.3s (21%)default, use_alloc, use_std
32.curl v0.4.421.6s1.1s (69%)default, http2, openssl-probe, openssl-sys, ssl
33.memchr v2.4.11.5s1.1s (73%)default, std, use_std
34.rand_xoshiro v0.4.01.5s1.3s (84%)
35.glob v0.3.01.4s1.2s (86%)
36.cc v1.0.581.3s0.8s (57%)jobserver, parallel
37.walkdir v2.3.11.3s1.1s (87%)
38.tempfile v3.1.01.2s1.0s (83%)
39.strsim v0.10.01.2s1.0s (87%)
40.rustfix v0.6.01.1s0.7s (66%)
41.unicode-normalization v0.1.131.1s0.4s (38%)default, std
42.tar v0.4.371.1s0.6s (55%)
43.textwrap v0.15.01.1s0.9s (82%)
44.jobserver v0.1.241.1s0.9s (85%)
45.bytes v1.1.01.0s0.6s (63%)default, std
46.flate2 v1.0.161.0s0.6s (59%)any_zlib, libz-sys, zlib
47.socket2 v0.4.21.0s0.8s (77%)
48.crossbeam-utils v0.8.10.9s0.7s (71%)default, lazy_static, std
49.crossbeam-utils v0.7.20.9s0.7s (71%)default, lazy_static, std
50.opener v0.5.00.9s0.8s (86%)
51.rand_chacha v0.2.20.9s0.6s (72%)std
52.proc-macro2 v1.0.290.8s0.4s (52%)default, proc-macro
53.os_info v3.1.00.8s0.4s (57%)default, serde
54.termcolor v1.1.20.7s0.5s (70%)
55.libc v0.2.1010.7s0.2s (22%)default, std
56.crossbeam-utils v0.8.1 build script (run)0.7sdefault, lazy_static, std
57.typenum v1.12.00.7s0.0s (6%)
58.crossbeam-utils v0.7.2 build script (run)0.7sdefault, lazy_static, std
59.semver v1.0.40.7s0.4s (62%)default, serde, std
60.libc v0.2.1010.6s0.1s (8%)default, std
61.openssl-sys v0.9.58 build script0.6s
62.pkg-config v0.3.180.6s0.4s (63%)
63.typenum v1.12.0 build script0.6s
64.flate2 v1.0.160.6s0.2s (26%)any_zlib, libz-sys, zlib
65.humantime v2.0.10.6s0.4s (68%)
66.cargo-platform v0.1.20.6s0.4s (65%)
67.hex v0.3.20.6s0.0s (6%)
68.openssl-sys v0.9.580.6s0.1s (19%)
69.anyhow v1.0.370.5s0.4s (65%)default, std
70.libgit2-sys v0.13.2+1.4.2 build script0.5shttps, libssh2-sys, openssl-sys, ssh, ssh_key_from_memory
71.cargo v0.62.0 build script0.5s
72.hashbrown v0.11.20.5s0.0s (7%)raw
73.curl-sys v0.4.52+curl-7.81.0 build script0.5sdefault, http2, libnghttp2-sys, openssl-sys, ssl
74.indexmap v1.8.00.5s0.1s (15%)std
75.libssh2-sys v0.2.20 build script0.5s
76.jobserver v0.1.240.4s0.3s (57%)
77.version_check v0.9.20.4s0.2s (54%)
78.thread_local v1.0.10.4s0.3s (62%)
79.libz-sys v1.1.2 build script0.4sdefault, libc, stock-zlib
80.git2-curl v0.15.00.4s0.3s (75%)
81.percent-encoding v2.1.00.4s0.3s (65%)
82.form_urlencoded v1.0.10.4s0.3s (66%)
83.autocfg v1.0.00.4s0.2s (57%)
84.shell-escape v0.1.50.4s0.3s (74%)
85.crypto-hash v0.3.40.4s0.3s (62%)
86.quote v1.0.70.4s0.2s (40%)default, proc-macro
87.libnghttp2-sys v0.1.4+1.41.0 build script0.4s
88.libc v0.2.101 build script0.4sdefault, std
89.ppv-lite86 v0.2.80.4s0.0s (5%)simd, std
90.semver v1.0.4 build script0.4sdefault, serde, std
91.hex v0.4.20.4s0.1s (19%)default, std
92.log v0.4.110.4s0.2s (51%)std
93.proc-macro2 v1.0.29 build script0.4sdefault, proc-macro
94.openssl-probe v0.1.20.4s0.3s (70%)
95.serde v1.0.130 build script0.4sdefault, derive, serde_derive, std
96.getrandom v0.1.140.4s0.2s (56%)std
97.anyhow v1.0.37 build script0.3sdefault, std
98.regex-automata v0.1.100.3s0.1s (25%)
99.syn v1.0.76 build script0.3sclone-impls, default, derive, parsing, printing, proc-macro, quote
100.crc32fast v1.2.0 build script0.3sdefault, std
101.ryu v1.0.50.3s0.2s (53%)
102.os_str_bytes v6.0.00.3s0.1s (38%)default, memchr, raw_os_str
103.filetime v0.2.120.3s0.2s (52%)
104.rand_core v0.5.10.3s0.1s (43%)alloc, getrandom, std
105.ryu v1.0.5 build script0.3s
106.bitflags v1.2.1 build script0.3sdefault
107.serde_derive v1.0.130 build script0.3sdefault
108.crc32fast v1.2.00.3s0.2s (52%)default, std
109.getrandom v0.1.14 build script0.3sstd
110.openssl v0.10.30 build script0.3s
111.im-rc v15.0.0 build script0.3s
112.memchr v2.4.1 build script0.3sdefault, std, use_std
113.home v0.5.30.3s0.2s (59%)
114.libnghttp2-sys v0.1.4+1.41.00.3s0.1s (41%)
115.tinyvec v0.3.30.3s0.0s (3%)alloc, default
116.serde_ignored v0.1.20.3s0.0s (18%)
117.serde_json v1.0.57 build script0.3sdefault, raw_value, std
118.sized-chunks v0.6.20.3s0.0s (5%)default, std
119.curl v0.4.42 build script0.3sdefault, http2, openssl-probe, openssl-sys, ssl
120.openssl-sys v0.9.58 build script (run)0.3s
121.log v0.4.11 build script0.3sstd
122.kstring v1.0.60.3s0.1s (22%)default, max_inline, serde
123.crossbeam-utils v0.8.1 build script0.3sdefault, lazy_static, std
124.indexmap v1.8.0 build script0.3sstd
125.crossbeam-utils v0.7.2 build script0.3sdefault, lazy_static, std
126.same-file v1.0.60.2s0.1s (45%)
127.anyhow v1.0.37 build script (run)0.2sdefault, std
128.filetime v0.2.120.2s0.1s (35%)
129.crc32fast v1.2.00.2s0.1s (24%)default, std
130.libgit2-sys v0.13.2+1.4.20.2s0.0s (15%)https, libssh2-sys, openssl-sys, ssh, ssh_key_from_memory
131.indexmap v1.8.0 build script (run)0.2sstd
132.bytesize v1.0.10.2s0.1s (37%)
133.libssh2-sys v0.2.200.2s0.1s (27%)
134.curl-sys v0.4.52+curl-7.81.00.2s0.0s (10%)default, http2, libnghttp2-sys, openssl-sys, ssl
135.vte v0.3.30.2s0.0s (15%)
136.itoa v0.4.60.2s0.0s (5%)
137.either v1.6.10.2s0.0s (6%)
138.lazycell v1.2.10.2s0.0s (14%)
139.unicode-xid v0.2.10.1s0.0s (12%)default
140.unicode-xid v0.2.10.1s0.0s (18%)default
141.libz-sys v1.1.20.1s0.0s (11%)default, libc, stock-zlib
142.utf8parse v0.1.10.1s0.0s (16%)
143.cfg-if v1.0.00.1s0.0s (7%)
144.unicode-width v0.1.80.1s0.0s (6%)default
145.libz-sys v1.1.20.1s0.0s (9%)default, libc, stock-zlib
146.strip-ansi-escapes v0.1.00.1s0.0s (8%)
147.atty v0.2.140.1s0.0s (10%)
148.foreign-types v0.3.20.1s0.0s (9%)
149.bitflags v1.2.10.1s0.0s (14%)default
150.lazy_static v1.4.00.1s0.0s (6%)
151.cfg-if v0.1.100.1s0.0s (6%)
152.matches v0.1.80.1s0.0s (7%)
153.foreign-types-shared v0.1.10.1s0.0s (7%)
154.remove_dir_all v0.5.30.1s0.0s (8%)
155.cfg-if v0.1.100.1s0.0s (12%)
156.fnv v1.0.70.1s0.0s (7%)default, std
157.rustc-workspace-hack v1.0.00.1s0.0s (9%)
158.crc32fast v1.2.0 build script (run)0.1sdefault, std
159.syn v1.0.76 build script (run)0.1sclone-impls, default, derive, parsing, printing, proc-macro, quote
160.libc v0.2.101 build script (run)0.1sdefault, std
161.semver v1.0.4 build script (run)0.1sdefault, serde, std
162.bitflags v1.2.1 build script (run)0.1sdefault
163.serde_derive v1.0.130 build script (run)0.1sdefault
164.proc-macro2 v1.0.29 build script (run)0.1sdefault, proc-macro
165.ryu v1.0.5 build script (run)0.1s
166.im-rc v15.0.0 build script (run)0.1s
167.serde v1.0.130 build script (run)0.1sdefault, derive, serde_derive, std
168.libc v0.2.101 build script (run)0.1sdefault, std
169.crc32fast v1.2.0 build script (run)0.1sdefault, std
170.typenum v1.12.0 build script (run)0.1s
171.cargo v0.62.0 build script (run)0.0s
172.curl-sys v0.4.52+curl-7.81.0 build script (run)0.0sdefault, http2, libnghttp2-sys, openssl-sys, ssl
173.libz-sys v1.1.2 build script (run)0.0sdefault, libc, stock-zlib
174.curl v0.4.42 build script (run)0.0sdefault, http2, openssl-probe, openssl-sys, ssl
175.libz-sys v1.1.2 build script (run)0.0sdefault, libc, stock-zlib
176.memchr v2.4.1 build script (run)0.0sdefault, std, use_std
177.openssl v0.10.30 build script (run)0.0s
178.log v0.4.11 build script (run)0.0sstd
179.getrandom v0.1.14 build script (run)0.0sstd
180.serde_json v1.0.57 build script (run)0.0sdefault, raw_value, std
+ + + From 8f95d6b948b2bf23ccc6b23e6a8aa0f0ea4fa279 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 21 Mar 2022 07:37:20 -0700 Subject: [PATCH 02/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Eric Huss --- posts/2022-04-07-Rust-1.60.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 28fdc5a57..f74c7b961 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -69,6 +69,7 @@ $ cargo build --timings ``` The report is also copied to `target/cargo-timings/cargo-timing.html`. A report on the release build of Cargo has been put up [here](/images/2022-04-07-timing.html). These reports can be useful for improving build performance. +More information about the timing reports may be found in the [documentation](https://doc.rust-lang.org/nightly/cargo/reference/timings.html). ### Weak feature dependencies in Cargo From 15933cfd23d839f9109d463adbdc5eb600a26e3a Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 21 Mar 2022 07:37:52 -0700 Subject: [PATCH 03/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Eric Huss --- posts/2022-04-07-Rust-1.60.0.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index f74c7b961..c41b96724 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -71,9 +71,11 @@ $ cargo build --timings The report is also copied to `target/cargo-timings/cargo-timing.html`. A report on the release build of Cargo has been put up [here](/images/2022-04-07-timing.html). These reports can be useful for improving build performance. More information about the timing reports may be found in the [documentation](https://doc.rust-lang.org/nightly/cargo/reference/timings.html). -### Weak feature dependencies in Cargo +### New syntax for Cargo features -Cargo has long supported [features](https://doc.rust-lang.org/cargo/reference/resolver.html#features) along with optional dependencies, as illustrated by the snippet below. +This release introduces two new changes to improve support for [Cargo features](https://doc.rust-lang.org/cargo/reference/features.html) and how they interact with [optional dependencies](https://doc.rust-lang.org/cargo/reference/features.html#optional-dependencies): Namespaced dependencies and weak dependency features. + +Cargo has long supported features along with optional dependencies, as illustrated by the snippet below. ```toml [dependencies] From 1248cfd0b23f6fa9ae3fa6cff1a8c719cdb760df Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 21 Mar 2022 07:39:00 -0700 Subject: [PATCH 04/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Eric Huss --- posts/2022-04-07-Rust-1.60.0.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index c41b96724..fe7ec1a16 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -86,7 +86,11 @@ jpeg-decoder = { version = "0.1.20", default-features = false, optional = true } parallel = ["jpeg-decoder/rayon"] ``` -The `"package-name/feature-name"` syntax will also enable package-name if it is an optional dependency. Often this is not what you want, and starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else enables the optional dependency. +There are two things to note in this example. First, the optional dependency `jpeg-decoder` implicitly defines a feature of the same name, which provides a means to enable the dependency. Second, the `"jpeg-decoder/rayon"` syntax enables the `rayon` feature of the `jpeg-decoder` dependency, *and* also enables the `jpeg-decoder` dependency. + +Namespaced features tackles the first issue that optional dependencies are implicitly exposed as part of a package's public interface. You can now use the `dep:` prefix in the `[features]` table to explicitly refer to an optional dependency. This gives you more control to define the feature corresponding to the optional dependency, and to hide optional dependencies behind more descriptive feature names. + +Weak dependency features tackles the second issue where the `"package-name/feature-name"` syntax would enable `package-name` if it is an optional dependency. Often this is not what you want, and starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else enables the optional dependency. For example, let's say we have added some serialization support to our library, and it requires enabling a corresponding feature in some optional dependencies. That can be done like this: From 01a16a60e58ab5c29f021ed889ff55fca40d1ad8 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 30 Mar 2022 09:17:41 -0400 Subject: [PATCH 05/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Ryan Levick --- posts/2022-04-07-Rust-1.60.0.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index fe7ec1a16..7954bdc58 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -86,7 +86,9 @@ jpeg-decoder = { version = "0.1.20", default-features = false, optional = true } parallel = ["jpeg-decoder/rayon"] ``` -There are two things to note in this example. First, the optional dependency `jpeg-decoder` implicitly defines a feature of the same name, which provides a means to enable the dependency. Second, the `"jpeg-decoder/rayon"` syntax enables the `rayon` feature of the `jpeg-decoder` dependency, *and* also enables the `jpeg-decoder` dependency. +There are two things to note in this example: +* The optional dependency `jpeg-decoder` implicitly defines a feature of the same name. Enabling the `jpeg-decoder` feature will enable the `jpeg-decoder` dependency. +* The `"jpeg-decoder/rayon"` syntax enables the `jpeg-decoder` dependency *and* enables the `jpeg-decoder` dependency's `rayon` feature. Namespaced features tackles the first issue that optional dependencies are implicitly exposed as part of a package's public interface. You can now use the `dep:` prefix in the `[features]` table to explicitly refer to an optional dependency. This gives you more control to define the feature corresponding to the optional dependency, and to hide optional dependencies behind more descriptive feature names. From f027b3de048c17822cfad71b5c6867a9a0d51bcc Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 30 Mar 2022 09:18:16 -0400 Subject: [PATCH 06/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Ryan Levick --- posts/2022-04-07-Rust-1.60.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 7954bdc58..58d3b46a7 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -90,7 +90,7 @@ There are two things to note in this example: * The optional dependency `jpeg-decoder` implicitly defines a feature of the same name. Enabling the `jpeg-decoder` feature will enable the `jpeg-decoder` dependency. * The `"jpeg-decoder/rayon"` syntax enables the `jpeg-decoder` dependency *and* enables the `jpeg-decoder` dependency's `rayon` feature. -Namespaced features tackles the first issue that optional dependencies are implicitly exposed as part of a package's public interface. You can now use the `dep:` prefix in the `[features]` table to explicitly refer to an optional dependency. This gives you more control to define the feature corresponding to the optional dependency, and to hide optional dependencies behind more descriptive feature names. +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. Weak dependency features tackles the second issue where the `"package-name/feature-name"` syntax would enable `package-name` if it is an optional dependency. Often this is not what you want, and starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else enables the optional dependency. From 5f778be1d744787933faa9bf44d9d97d06b78c04 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Wed, 30 Mar 2022 09:19:06 -0400 Subject: [PATCH 07/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Ryan Levick --- posts/2022-04-07-Rust-1.60.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 58d3b46a7..9fd9edd1b 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -92,7 +92,7 @@ There are two things to note in this example: 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. -Weak dependency features tackles the second issue where the `"package-name/feature-name"` syntax would enable `package-name` if it is an optional dependency. Often this is not what you want, and starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else enables the optional dependency. +Weak dependency features tackle the second issue where the `"optional-dependency/feature-name"` syntax would always enable `optional-dependency`. However, often you want to enable the feature on the optional dependency *only* if some other feature has enabled the optional dependency. Starting in 1.60, you can add a ? as in `"package-name?/feature-name"` which will only enable the given feature if something else has enabled the optional dependency. For example, let's say we have added some serialization support to our library, and it requires enabling a corresponding feature in some optional dependencies. That can be done like this: From af31313119cddc3e8a06610bd49a5adf62e52228 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 1 Apr 2022 11:12:54 -0400 Subject: [PATCH 08/11] Adjustments --- posts/2022-04-07-Rust-1.60.0.md | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 9fd9edd1b..59717268d 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -25,18 +25,25 @@ the beta channel (`rustup default beta`) or the nightly channel (`rustup default ## What's in 1.60.0 stable -### Instrumentation-based Code Coverage +### Source-based Code Coverage -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`: +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: ```shell= RUSTFLAGS="-C instrument-coverage" cargo build ``` -After that, you can run the resulting binary, which will produce -a `default.profraw` file in the current directory. That can be consumed -by the `llvm-cov` binary shipped with rustc as part of the llvm-tools-preview -component. +After that, you can run the resulting binary, which will produce a +`default.profraw` file in the current directory. (The path and filename can be +overriden by an environment variable; see +[documentation](https://doc.rust-lang.org/stable/rustc/instrument-coverage.html#running-the-instrumented-binary-to-generate-raw-coverage-profiling-data) +for details). + +The `llvm-tools-preview` component includes `llvm-profdata` for processing and +merging raw profile output (coverage region execution counts); and `llvm-cov` +for report generation. `llvm-cov` combines the processed output, from +`llvm-profdata`, and the binary itself, because the binary embeds a mapping from +counters to actual source code regions. ```shell= rustup component add llvm-tools-preview @@ -55,7 +62,13 @@ The above commands on a simple helloworld binary produce this annotated report, 3| 1|} ``` -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. +For more details, please read the +[documentation](https://doc.rust-lang.org/rustc/instrument-coverage.html) in the +rustc book. While the specific output format and LLVM tooling which produces it +are subject to change, the baseline functionality is stable and will exist in +some form in all future Rust releases. For this reason, it is important to make +sure that you use the same version for both the `llvm-tools-preview` and the +rustc binary used to compile your code. ### `cargo --timings` @@ -87,7 +100,7 @@ parallel = ["jpeg-decoder/rayon"] ``` There are two things to note in this example: -* The optional dependency `jpeg-decoder` implicitly defines a feature of the same name. Enabling the `jpeg-decoder` feature will enable the `jpeg-decoder` dependency. +* The optional dependency `jpeg-decoder` implicitly defines a feature of the same name. Enabling the `jpeg-decoder` feature will enable the `jpeg-decoder` dependency. * The `"jpeg-decoder/rayon"` syntax enables the `jpeg-decoder` dependency *and* enables the `jpeg-decoder` dependency's `rayon` feature. 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 ### Incremental compilation status -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. +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. ### Stabilized APIs From 623ec6a94b6b6506823c343a5a2a4359d197da8d Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Fri, 1 Apr 2022 17:26:02 -0400 Subject: [PATCH 09/11] Update posts/2022-04-07-Rust-1.60.0.md Co-authored-by: Tyler Mandry --- posts/2022-04-07-Rust-1.60.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 59717268d..9cc9b1711 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -64,9 +64,9 @@ The above commands on a simple helloworld binary produce this annotated report, For more details, please read the [documentation](https://doc.rust-lang.org/rustc/instrument-coverage.html) in the -rustc book. While the specific output format and LLVM tooling which produces it -are subject to change, the baseline functionality is stable and will exist in -some form in all future Rust releases. For this reason, it is important to make +rustc book. The baseline functionality is stable and will exist in some form +in all future Rust releases, but the specific output format and LLVM tooling which +produces it are subject to change. For this reason, it is important to make sure that you use the same version for both the `llvm-tools-preview` and the rustc binary used to compile your code. From 5e7e07a3ae63030cf59a9fedbd558f87c5834bb3 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Tue, 5 Apr 2022 13:53:59 -0400 Subject: [PATCH 10/11] Add Instant monotonicity section --- posts/2022-04-07-Rust-1.60.0.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 9cc9b1711..2e8d1f732 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -124,6 +124,32 @@ In this example, enabling the serde feature will enable the serde dependency. It 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. +### `Instant` monotonicity guarantees + +On all platforms `Instant` will try to use an OS API that guarantees monotonic +behavior if available (which is the case on all tier 1 platforms). In practice +such guarantees are -- under rare circumstances -- broken by hardware, +virtualization or operating system bugs. To work around these bugs and platforms +not offering monotonic clocks `Instant::duration_since`, `Instant::elapsed` and +`Instant::sub` saturate to zero. In older Rust versions this lead to a panic +instead. `Instant::checked_duration_since` can be used to detect and handle +situations where monotonicity is violated, or `Instant`s are subtracted in the +wrong order. + +This workaround obscures programming errors where earlier and later instants are +accidentally swapped. For this reason future Rust versions may reintroduce +panics in at least those cases. + +Prior to 1.60, the monotonicity guarantees were provided through mutexes or +atomics in std, which can introduce large performance overheads to +`Instant::now()`. Additionally, the panicking behavior meant that Rust software +could panic in a subset of environments, which was largely undesirable, as the +authors of that software may not be in a place to upgrade the operating system, +hardware, or virtualization system they are running on. Further, introducing +unexpected panics into these environments make Rust software less reliable and +portable, which is of higher concern than exposing typically uninteresting +platform bugs to end users. + ### Stabilized APIs The following methods and trait implementations are now stabilized: From ffc8e267ddd7206c98406342163e7d5da29076d2 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Thu, 7 Apr 2022 14:43:39 +0200 Subject: [PATCH 11/11] Apply suggestions from code review Co-authored-by: Josh Triplett --- posts/2022-04-07-Rust-1.60.0.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/posts/2022-04-07-Rust-1.60.0.md b/posts/2022-04-07-Rust-1.60.0.md index 2e8d1f732..4a96a1c95 100644 --- a/posts/2022-04-07-Rust-1.60.0.md +++ b/posts/2022-04-07-Rust-1.60.0.md @@ -129,26 +129,26 @@ Incremental compilation is re-enabled for the 1.60 release. The Rust team contin On all platforms `Instant` will try to use an OS API that guarantees monotonic behavior if available (which is the case on all tier 1 platforms). In practice such guarantees are -- under rare circumstances -- broken by hardware, -virtualization or operating system bugs. To work around these bugs and platforms -not offering monotonic clocks `Instant::duration_since`, `Instant::elapsed` and -`Instant::sub` saturate to zero. In older Rust versions this lead to a panic +virtualization, or operating system bugs. To work around these bugs and platforms +not offering monotonic clocks, `Instant::duration_since`, `Instant::elapsed` and +`Instant::sub` now saturate to zero. In older Rust versions this led to a panic instead. `Instant::checked_duration_since` can be used to detect and handle situations where monotonicity is violated, or `Instant`s are subtracted in the wrong order. This workaround obscures programming errors where earlier and later instants are accidentally swapped. For this reason future Rust versions may reintroduce -panics in at least those cases. +panics in at least those cases, if possible and efficient. Prior to 1.60, the monotonicity guarantees were provided through mutexes or atomics in std, which can introduce large performance overheads to `Instant::now()`. Additionally, the panicking behavior meant that Rust software could panic in a subset of environments, which was largely undesirable, as the -authors of that software may not be in a place to upgrade the operating system, +authors of that software may not be able to fix or upgrade the operating system, hardware, or virtualization system they are running on. Further, introducing -unexpected panics into these environments make Rust software less reliable and +unexpected panics into these environments made Rust software less reliable and portable, which is of higher concern than exposing typically uninteresting -platform bugs to end users. +platform bugs in monotonic clock handling to end users. ### Stabilized APIs