Skip to content

Commit 02072b4

Browse files
committed
Auto merge of #92723 - pietroalbini:1.58.0, r=pietroalbini
[stable] Prepare Rust 1.58.0 release Backported the release notes currently on master plus: * #92693 * #92703 r? `@ghost` cc `@rust-lang/release`
2 parents 4aa9d23 + 63608d0 commit 02072b4

File tree

2 files changed

+291
-1
lines changed

2 files changed

+291
-1
lines changed

RELEASES.md

+290
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,289 @@
1+
Version 1.58.0 (2022-01-13)
2+
==========================
3+
4+
Language
5+
--------
6+
7+
- [Format strings can now capture arguments simply by writing `{ident}` in the string.][90473] This works in all macros accepting format strings. Support for this in `panic!` (`panic!("{ident}")`) requires the 2021 edition; panic invocations in previous editions that appear to be trying to use this will result in a warning lint about not having the intended effect.
8+
- [`*const T` pointers can now be dereferenced in const contexts.][89551]
9+
- [The rules for when a generic struct implements `Unsize` have been relaxed.][90417]
10+
11+
Compiler
12+
--------
13+
14+
- [Add LLVM CFI support to the Rust compiler][89652]
15+
- [Stabilize -Z strip as -C strip][90058]. Note that while release builds already don't add debug symbols for the code you compile, the compiled standard library that ships with Rust includes debug symbols, so you may want to use the `strip` option to remove these symbols to produce smaller release binaries. Note that this release only includes support in rustc, not directly in cargo.
16+
- [Add support for LLVM coverage mapping format versions 5 and 6][91207]
17+
- [Emit LLVM optimization remarks when enabled with `-Cremark`][90833]
18+
- [Update the minimum external LLVM to 12][90175]
19+
- [Add `x86_64-unknown-none` at Tier 3*][89062]
20+
- [Build musl dist artifacts with debuginfo enabled][90733]. When building release binaries using musl, you may want to use the newly stabilized strip option to remove these debug symbols, reducing the size of your binaries.
21+
- [Don't abort compilation after giving a lint error][87337]
22+
- [Error messages point at the source of trait bound obligations in more places][89580]
23+
24+
\* Refer to Rust's [platform support page][platform-support-doc] for more
25+
information on Rust's tiered platform support.
26+
27+
Libraries
28+
---------
29+
30+
- [All remaining functions in the standard library have `#[must_use]` annotations where appropriate][89692], producing a warning when ignoring their return value. This helps catch mistakes such as expecting a function to mutate a value in place rather than return a new value.
31+
- [Paths are automatically canonicalized on Windows for operations that support it][89174]
32+
- [Re-enable debug checks for `copy` and `copy_nonoverlapping`][90041]
33+
- [Implement `RefUnwindSafe` for `Rc<T>`][87467]
34+
- [Make RSplit<T, P>: Clone not require T: Clone][90117]
35+
- [Implement `Termination` for `Result<Infallible, E>`][88601]. This allows writing `fn main() -> Result<Infallible, ErrorType>`, for a program whose successful exits never involve returning from `main` (for instance, a program that calls `exit`, or that uses `exec` to run another program).
36+
37+
Stabilized APIs
38+
---------------
39+
40+
- [`Metadata::is_symlink`]
41+
- [`Path::is_symlink`]
42+
- [`{integer}::saturating_div`]
43+
- [`Option::unwrap_unchecked`]
44+
- [`Result::unwrap_unchecked`]
45+
- [`Result::unwrap_err_unchecked`]
46+
- [`NonZero{unsigned}::is_power_of_two`]
47+
- [`File::options`]
48+
49+
These APIs are now usable in const contexts:
50+
51+
- [`Duration::new`]
52+
- [`Duration::checked_add`]
53+
- [`Duration::saturating_add`]
54+
- [`Duration::checked_sub`]
55+
- [`Duration::saturating_sub`]
56+
- [`Duration::checked_mul`]
57+
- [`Duration::saturating_mul`]
58+
- [`Duration::checked_div`]
59+
- [`MaybeUninit::as_ptr`]
60+
- [`MaybeUninit::as_mut_ptr`]
61+
- [`MaybeUninit::assume_init`]
62+
- [`MaybeUninit::assume_init_ref`]
63+
64+
Cargo
65+
-----
66+
67+
- [Add --message-format for install command][cargo/10107]
68+
- [Warn when alias shadows external subcommand][cargo/10082]
69+
70+
Rustdoc
71+
-------
72+
73+
- [Show all Deref implementations recursively in rustdoc][90183]
74+
- [Use computed visibility in rustdoc][88447]
75+
76+
Compatibility Notes
77+
-------------------
78+
79+
- [Try all stable method candidates first before trying unstable ones][90329]. This change ensures that adding new nightly-only methods to the Rust standard library will not break code invoking methods of the same name from traits outside the standard library.
80+
- Windows: [`std::process::Command` will no longer search the current directory for executables.][87704]
81+
- [All proc-macro backward-compatibility lints are now deny-by-default.][88041]
82+
- [proc_macro: Append .0 to unsuffixed float if it would otherwise become int token][90297]
83+
- [Refactor weak symbols in std::sys::unix][90846]. This optimizes accesses to glibc functions, by avoiding the use of dlopen. This does not increase the [minimum expected version of glibc](https://doc.rust-lang.org/nightly/rustc/platform-support.html). However, software distributions that use symbol versions to detect library dependencies, and which take weak symbols into account in that analysis, may detect rust binaries as requiring newer versions of glibc.
84+
- [rustdoc now rejects some unexpected semicolons in doctests][91026]
85+
86+
Internal Changes
87+
----------------
88+
89+
These changes provide no direct user facing benefits, but represent significant
90+
improvements to the internals and overall performance of rustc
91+
and related tools.
92+
93+
- [Implement coherence checks for negative trait impls][90104]
94+
- [Add rustc lint, warning when iterating over hashmaps][89558]
95+
- [Optimize live point computation][90491]
96+
- [Enable verification for 1/32nd of queries loaded from disk][90361]
97+
- [Implement version of normalize_erasing_regions that allows for normalization failure][91255]
98+
99+
[87337]: https://github.com/rust-lang/rust/pull/87337/
100+
[87467]: https://github.com/rust-lang/rust/pull/87467/
101+
[87704]: https://github.com/rust-lang/rust/pull/87704/
102+
[88041]: https://github.com/rust-lang/rust/pull/88041/
103+
[88300]: https://github.com/rust-lang/rust/pull/88300/
104+
[88447]: https://github.com/rust-lang/rust/pull/88447/
105+
[88601]: https://github.com/rust-lang/rust/pull/88601/
106+
[88624]: https://github.com/rust-lang/rust/pull/88624/
107+
[89062]: https://github.com/rust-lang/rust/pull/89062/
108+
[89174]: https://github.com/rust-lang/rust/pull/89174/
109+
[89542]: https://github.com/rust-lang/rust/pull/89542/
110+
[89551]: https://github.com/rust-lang/rust/pull/89551/
111+
[89558]: https://github.com/rust-lang/rust/pull/89558/
112+
[89580]: https://github.com/rust-lang/rust/pull/89580/
113+
[89652]: https://github.com/rust-lang/rust/pull/89652/
114+
[89677]: https://github.com/rust-lang/rust/pull/89677/
115+
[89951]: https://github.com/rust-lang/rust/pull/89951/
116+
[90041]: https://github.com/rust-lang/rust/pull/90041/
117+
[90058]: https://github.com/rust-lang/rust/pull/90058/
118+
[90104]: https://github.com/rust-lang/rust/pull/90104/
119+
[90117]: https://github.com/rust-lang/rust/pull/90117/
120+
[90175]: https://github.com/rust-lang/rust/pull/90175/
121+
[90183]: https://github.com/rust-lang/rust/pull/90183/
122+
[90297]: https://github.com/rust-lang/rust/pull/90297/
123+
[90329]: https://github.com/rust-lang/rust/pull/90329/
124+
[90361]: https://github.com/rust-lang/rust/pull/90361/
125+
[90417]: https://github.com/rust-lang/rust/pull/90417/
126+
[90473]: https://github.com/rust-lang/rust/pull/90473/
127+
[90491]: https://github.com/rust-lang/rust/pull/90491/
128+
[90733]: https://github.com/rust-lang/rust/pull/90733/
129+
[90833]: https://github.com/rust-lang/rust/pull/90833/
130+
[90846]: https://github.com/rust-lang/rust/pull/90846/
131+
[90896]: https://github.com/rust-lang/rust/pull/90896/
132+
[91026]: https://github.com/rust-lang/rust/pull/91026/
133+
[91207]: https://github.com/rust-lang/rust/pull/91207/
134+
[91255]: https://github.com/rust-lang/rust/pull/91255/
135+
[91301]: https://github.com/rust-lang/rust/pull/91301/
136+
[cargo/10082]: https://github.com/rust-lang/cargo/pull/10082/
137+
[cargo/10107]: https://github.com/rust-lang/cargo/pull/10107/
138+
[`Metadata::is_symlink`]: https://doc.rust-lang.org/stable/std/fs/struct.Metadata.html#method.is_symlink
139+
[`Path::is_symlink`]: https://doc.rust-lang.org/stable/std/path/struct.Path.html#method.is_symlink
140+
[`{integer}::saturating_div`]: https://doc.rust-lang.org/stable/std/primitive.i8.html#method.saturating_div
141+
[`Option::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unwrap_unchecked
142+
[`Result::unwrap_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_unchecked
143+
[`Result::unwrap_err_unchecked`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.unwrap_err_unchecked
144+
[`NonZero{unsigned}::is_power_of_two`]: https://doc.rust-lang.org/stable/std/num/struct.NonZeroU8.html#method.is_power_of_two
145+
[`File::options`]: https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.options
146+
[`unix::process::ExitStatusExt::core_dumped`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.core_dumped
147+
[`unix::process::ExitStatusExt::stopped_signal`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.stopped_signal
148+
[`unix::process::ExitStatusExt::continued`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.continued
149+
[`unix::process::ExitStatusExt::into_raw`]: https://doc.rust-lang.org/stable/std/os/unix/process/trait.ExitStatusExt.html#tymethod.into_raw
150+
[`Duration::new`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.new
151+
[`Duration::checked_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_add
152+
[`Duration::saturating_add`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_add
153+
[`Duration::checked_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_sub
154+
[`Duration::saturating_sub`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_sub
155+
[`Duration::checked_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_mul
156+
[`Duration::saturating_mul`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.saturating_mul
157+
[`Duration::checked_div`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.checked_div
158+
[`Duration::as_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f64
159+
[`Duration::as_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.as_secs_f32
160+
[`Duration::from_secs_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f64
161+
[`Duration::from_secs_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.from_secs_f32
162+
[`Duration::mul_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f64
163+
[`Duration::mul_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.mul_f32
164+
[`Duration::div_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f64
165+
[`Duration::div_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_f32
166+
[`Duration::div_duration_f64`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f64
167+
[`Duration::div_duration_f32`]: https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.div_duration_f32
168+
[`MaybeUninit::as_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_ptr
169+
[`MaybeUninit::as_mut_ptr`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.as_mut_ptr
170+
[`MaybeUninit::assume_init`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init
171+
[`MaybeUninit::assume_init_ref`]: https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.assume_init_ref
172+
173+
Version 1.57.0 (2021-12-02)
174+
==========================
175+
176+
Language
177+
--------
178+
179+
- [Macro attributes may follow `#[derive]` and will see the original (pre-`cfg`) input.][87220]
180+
- [Accept curly-brace macros in expressions, like `m!{ .. }.method()` and `m!{ .. }?`.][88690]
181+
- [Allow panicking in constant evaluation.][89508]
182+
183+
Compiler
184+
--------
185+
186+
- [Create more accurate debuginfo for vtables.][89597]
187+
- [Add `armv6k-nintendo-3ds` at Tier 3\*.][88529]
188+
- [Add `armv7-unknown-linux-uclibceabihf` at Tier 3\*.][88952]
189+
- [Add `m68k-unknown-linux-gnu` at Tier 3\*.][88321]
190+
- [Add SOLID targets at Tier 3\*:][86191] `aarch64-kmc-solid_asp3`, `armv7a-kmc-solid_asp3-eabi`, `armv7a-kmc-solid_asp3-eabihf`
191+
192+
\* Refer to Rust's [platform support page][platform-support-doc] for more
193+
information on Rust's tiered platform support.
194+
195+
Libraries
196+
---------
197+
198+
- [Avoid allocations and copying in `Vec::leak`][89337]
199+
- [Add `#[repr(i8)]` to `Ordering`][89507]
200+
- [Optimize `File::read_to_end` and `read_to_string`][89582]
201+
- [Update to Unicode 14.0][89614]
202+
- [Many more functions are marked `#[must_use]`][89692], producing a warning
203+
when ignoring their return value. This helps catch mistakes such as expecting
204+
a function to mutate a value in place rather than return a new value.
205+
206+
Stabilised APIs
207+
---------------
208+
209+
- [`[T; N]::as_mut_slice`][`array::as_mut_slice`]
210+
- [`[T; N]::as_slice`][`array::as_slice`]
211+
- [`collections::TryReserveError`]
212+
- [`HashMap::try_reserve`]
213+
- [`HashSet::try_reserve`]
214+
- [`String::try_reserve`]
215+
- [`String::try_reserve_exact`]
216+
- [`Vec::try_reserve`]
217+
- [`Vec::try_reserve_exact`]
218+
- [`VecDeque::try_reserve`]
219+
- [`VecDeque::try_reserve_exact`]
220+
- [`Iterator::map_while`]
221+
- [`iter::MapWhile`]
222+
- [`proc_macro::is_available`]
223+
- [`Command::get_program`]
224+
- [`Command::get_args`]
225+
- [`Command::get_envs`]
226+
- [`Command::get_current_dir`]
227+
- [`CommandArgs`]
228+
- [`CommandEnvs`]
229+
230+
These APIs are now usable in const contexts:
231+
232+
- [`hint::unreachable_unchecked`]
233+
234+
Cargo
235+
-----
236+
237+
- [Stabilize custom profiles][cargo/9943]
238+
239+
Compatibility notes
240+
-------------------
241+
242+
Internal changes
243+
----------------
244+
These changes provide no direct user facing benefits, but represent significant
245+
improvements to the internals and overall performance of rustc
246+
and related tools.
247+
248+
- [Added an experimental backend for codegen with `libgccjit`.][87260]
249+
250+
[86191]: https://github.com/rust-lang/rust/pull/86191/
251+
[87220]: https://github.com/rust-lang/rust/pull/87220/
252+
[87260]: https://github.com/rust-lang/rust/pull/87260/
253+
[88243]: https://github.com/rust-lang/rust/pull/88243/
254+
[88321]: https://github.com/rust-lang/rust/pull/88321/
255+
[88529]: https://github.com/rust-lang/rust/pull/88529/
256+
[88690]: https://github.com/rust-lang/rust/pull/88690/
257+
[88952]: https://github.com/rust-lang/rust/pull/88952/
258+
[89337]: https://github.com/rust-lang/rust/pull/89337/
259+
[89507]: https://github.com/rust-lang/rust/pull/89507/
260+
[89508]: https://github.com/rust-lang/rust/pull/89508/
261+
[89582]: https://github.com/rust-lang/rust/pull/89582/
262+
[89597]: https://github.com/rust-lang/rust/pull/89597/
263+
[89614]: https://github.com/rust-lang/rust/pull/89614/
264+
[89692]: https://github.com/rust-lang/rust/issues/89692/
265+
[cargo/9943]: https://github.com/rust-lang/cargo/pull/9943/
266+
[`array::as_mut_slice`]: https://doc.rust-lang.org/std/primitive.array.html#method.as_mut_slice
267+
[`array::as_slice`]: https://doc.rust-lang.org/std/primitive.array.html#method.as_slice
268+
[`collections::TryReserveError`]: https://doc.rust-lang.org/std/collections/struct.TryReserveError.html
269+
[`HashMap::try_reserve`]: https://doc.rust-lang.org/std/collections/hash_map/struct.HashMap.html#method.try_reserve
270+
[`HashSet::try_reserve`]: https://doc.rust-lang.org/std/collections/hash_set/struct.HashSet.html#method.try_reserve
271+
[`String::try_reserve`]: https://doc.rust-lang.org/alloc/string/struct.String.html#method.try_reserve
272+
[`String::try_reserve_exact`]: https://doc.rust-lang.org/alloc/string/struct.String.html#method.try_reserve_exact
273+
[`Vec::try_reserve`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.try_reserve
274+
[`Vec::try_reserve_exact`]: https://doc.rust-lang.org/std/vec/struct.Vec.html#method.try_reserve_exact
275+
[`VecDeque::try_reserve`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.try_reserve
276+
[`VecDeque::try_reserve_exact`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.try_reserve_exact
277+
[`Iterator::map_while`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.map_while
278+
[`iter::MapWhile`]: https://doc.rust-lang.org/std/iter/struct.MapWhile.html
279+
[`proc_macro::is_available`]: https://doc.rust-lang.org/proc_macro/fn.is_available.html
280+
[`Command::get_program`]: https://doc.rust-lang.org/std/process/struct.Command.html#method.get_program
281+
[`Command::get_args`]: https://doc.rust-lang.org/std/process/struct.Command.html#method.get_args
282+
[`Command::get_envs`]: https://doc.rust-lang.org/std/process/struct.Command.html#method.get_envs
283+
[`Command::get_current_dir`]: https://doc.rust-lang.org/std/process/struct.Command.html#method.get_current_dir
284+
[`CommandArgs`]: https://doc.rust-lang.org/std/process/struct.CommandArgs.html
285+
[`CommandEnvs`]: https://doc.rust-lang.org/std/process/struct.CommandEnvs.html
286+
1287
Version 1.56.1 (2021-11-01)
2288
===========================
3289

@@ -274,6 +560,10 @@ Compatibility Notes
274560
`Command` would cause them to be ASCII-uppercased.
275561
- [Rustdoc will now warn on using rustdoc lints that aren't prefixed
276562
with `rustdoc::`][86849]
563+
- `RUSTFLAGS` is no longer set for build scripts. Build scripts
564+
should use `CARGO_ENCODED_RUSTFLAGS` instead. See the
565+
[documentation](https://doc.rust-lang.org/nightly/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
566+
for more details.
277567

278568
[86849]: https://github.com/rust-lang/rust/pull/86849
279569
[86513]: https://github.com/rust-lang/rust/pull/86513

src/ci/channel

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
beta
1+
stable

0 commit comments

Comments
 (0)