Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 09c42c4

Browse files
committed
Auto merge of #90004 - pietroalbini:stable-next, r=pietroalbini
Rust 1.56.0 stable release This PR bumps 1.56.0 to the stable channel. This also includes a backport for: * Latest changes to the release notes * #89867 r? `@ghost` cc `@rust-lang/release`
2 parents 7eda943 + 7b9189a commit 09c42c4

File tree

5 files changed

+228
-7
lines changed

5 files changed

+228
-7
lines changed

‎RELEASES.md

Lines changed: 185 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,185 @@
1+
Version 1.56.0 (2021年10月21日)
2+
========================
3+
4+
Language
5+
--------
6+
7+
- [The 2021 Edition is now stable.][rust#88100]
8+
See [the edition guide][rust-2021-edition-guide] for more details.
9+
- [The pattern in `binding @ pattern` can now also introduce new bindings.][rust#85305]
10+
- [Union field access is permitted in `const fn`.][rust#85769]
11+
12+
[rust-2021-edition-guide]: https://doc.rust-lang.org/nightly/edition-guide/rust-2021/index.html
13+
14+
Compiler
15+
--------
16+
17+
- [Upgrade to LLVM 13.][rust#87570]
18+
- [Support memory, address, and thread sanitizers on aarch64-unknown-freebsd.][rust#88023]
19+
- [Allow specifying a deployment target version for all iOS targets][rust#87699]
20+
- [Warnings can be forced on with `--force-warn`.][rust#87472]
21+
This feature is primarily intended for usage by `cargo fix`, rather than end users.
22+
- [Promote `aarch64-apple-ios-sim` to Tier 2\*.][rust#87760]
23+
- [Add `powerpc-unknown-freebsd` at Tier 3\*.][rust#87370]
24+
- [Add `riscv32imc-esp-espidf` at Tier 3\*.][rust#87666]
25+
26+
\* Refer to Rust's [platform support page][platform-support-doc] for more
27+
information on Rust's tiered platform support.
28+
29+
Libraries
30+
---------
31+
32+
- [Allow writing of incomplete UTF-8 sequences via stdout/stderr on Windows.][rust#83342]
33+
The Windows console still requires valid Unicode, but this change allows
34+
splitting a UTF-8 character across multiple write calls. This allows, for
35+
instance, programs that just read and write data buffers (e.g. copying a file
36+
to stdout) without regard for Unicode or character boundaries.
37+
- [Prefer `AtomicU{64,128}` over Mutex for Instant backsliding protection.][rust#83093]
38+
For this use case, atomics scale much better under contention.
39+
- [Implement `Extend<(A, B)>` for `(Extend<A>, Extend<B>)`][rust#85835]
40+
- [impl Default, Copy, Clone for std::io::Sink and std::io::Empty][rust#86744]
41+
- [`impl From<[(K, V); N]>` for all collections.][rust#84111]
42+
- [Remove `P: Unpin` bound on impl Future for Pin.][rust#81363]
43+
- [Treat invalid environment variable names as non-existent.][rust#86183]
44+
Previously, the environment functions would panic if given a variable name
45+
with an internal null character or equal sign (`=`). Now, these functions will
46+
just treat such names as non-existent variables, since the OS cannot represent
47+
the existence of a variable with such a name.
48+
49+
Stabilised APIs
50+
---------------
51+
52+
- [`std::os::unix::fs::chroot`]
53+
- [`UnsafeCell::raw_get`]
54+
- [`BufWriter::into_parts`]
55+
- [`core::panic::{UnwindSafe, RefUnwindSafe, AssertUnwindSafe}`]
56+
These APIs were previously stable in `std`, but are now also available in `core`.
57+
- [`Vec::shrink_to`]
58+
- [`String::shrink_to`]
59+
- [`OsString::shrink_to`]
60+
- [`PathBuf::shrink_to`]
61+
- [`BinaryHeap::shrink_to`]
62+
- [`VecDeque::shrink_to`]
63+
- [`HashMap::shrink_to`]
64+
- [`HashSet::shrink_to`]
65+
66+
These APIs are now usable in const contexts:
67+
68+
- [`std::mem::transmute`]
69+
- [`[T]::first`][`slice::first`]
70+
- [`[T]::split_first`][`slice::split_first`]
71+
- [`[T]::last`][`slice::last`]
72+
- [`[T]::split_last`][`slice::split_last`]
73+
74+
Cargo
75+
-----
76+
77+
- [Cargo supports specifying a minimum supported Rust version in Cargo.toml.][`rust-version`]
78+
This has no effect at present on dependency version selection.
79+
We encourage crates to specify their minimum supported Rust version, and we encourage CI systems
80+
that support Rust code to include a crate's specified minimum version in the text matrix for that
81+
crate by default.
82+
83+
Compatibility notes
84+
-------------------
85+
86+
- [Update to new argument parsing rules on Windows.][rust#87580]
87+
This adjusts Rust's standard library to match the behavior of the standard
88+
libraries for C/C++. The rules have changed slightly over time, and this PR
89+
brings us to the latest set of rules (changed in 2008).
90+
- [Disallow the aapcs calling convention on aarch64][rust#88399]
91+
This was already not supported by LLVM; this change surfaces this lack of
92+
support with a better error message.
93+
- [Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default][rust#87385]
94+
- [Warn when an escaped newline skips multiple lines.][rust#87671]
95+
- [Calls to `libc::getpid` / `std::process::id` from `Command::pre_exec`
96+
may return different values on glibc <= 2.24.][rust#81825]
97+
Rust now invokes the `clone3` system call directly, when available, to use new functionality
98+
available via that system call. Older versions of glibc cache the result of `getpid`, and only
99+
update that cache when calling glibc's clone/fork functions, so a direct system call bypasses
100+
that cache update. glibc 2.25 and newer no longer cache `getpid` for exactly this reason.
101+
102+
Internal changes
103+
----------------
104+
These changes provide no direct user facing benefits, but represent significant
105+
improvements to the internals and overall performance of rustc
106+
and related tools.
107+
108+
- [LLVM is compiled with PGO in published x86_64-unknown-linux-gnu artifacts.][rust#88069]
109+
This improves the performance of most Rust builds.
110+
- [Unify representation of macros in internal data structures.][rust#88019]
111+
This change fixes a host of bugs with the handling of macros by the compiler,
112+
as well as rustdoc.
113+
114+
[`std::os::unix::fs::chroot`]: https://doc.rust-lang.org/stable/std/os/unix/fs/fn.chroot.html
115+
[`Iterator::intersperse`]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.intersperse
116+
[`Iterator::intersperse_with`]: https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html#method.intersperse
117+
[`UnsafeCell::raw_get`]: https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell.html#method.raw_get
118+
[`BufWriter::into_parts`]: https://doc.rust-lang.org/stable/std/io/struct.BufWriter.html#method.into_parts
119+
[`core::panic::{UnwindSafe, RefUnwindSafe, AssertUnwindSafe}`]: https://github.com/rust-lang/rust/pull/84662
120+
[`Vec::shrink_to`]: https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.shrink_to
121+
[`String::shrink_to`]: https://doc.rust-lang.org/stable/std/string/struct.String.html#method.shrink_to
122+
[`OsString::shrink_to`]: https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.shrink_to
123+
[`PathBuf::shrink_to`]: https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.shrink_to
124+
[`BinaryHeap::shrink_to`]: https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#method.shrink_to
125+
[`VecDeque::shrink_to`]: https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.shrink_to
126+
[`HashMap::shrink_to`]: https://doc.rust-lang.org/stable/std/collections/hash_map/struct.HashMap.html#method.shrink_to
127+
[`HashSet::shrink_to`]: https://doc.rust-lang.org/stable/std/collections/hash_set/struct.HashSet.html#method.shrink_to
128+
[`std::mem::transmute`]: https://doc.rust-lang.org/stable/std/mem/fn.transmute.html
129+
[`slice::first`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.first
130+
[`slice::split_first`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_first
131+
[`slice::last`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.last
132+
[`slice::split_last`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.split_last
133+
[`rust-version`]: https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-rust-version-field
134+
[rust#87671]: https://github.com/rust-lang/rust/pull/87671
135+
[rust#86183]: https://github.com/rust-lang/rust/pull/86183
136+
[rust#87385]: https://github.com/rust-lang/rust/pull/87385
137+
[rust#88100]: https://github.com/rust-lang/rust/pull/88100
138+
[rust#86860]: https://github.com/rust-lang/rust/pull/86860
139+
[rust#84039]: https://github.com/rust-lang/rust/pull/84039
140+
[rust#86492]: https://github.com/rust-lang/rust/pull/86492
141+
[rust#88363]: https://github.com/rust-lang/rust/pull/88363
142+
[rust#85305]: https://github.com/rust-lang/rust/pull/85305
143+
[rust#87832]: https://github.com/rust-lang/rust/pull/87832
144+
[rust#88069]: https://github.com/rust-lang/rust/pull/88069
145+
[rust#87472]: https://github.com/rust-lang/rust/pull/87472
146+
[rust#87699]: https://github.com/rust-lang/rust/pull/87699
147+
[rust#87570]: https://github.com/rust-lang/rust/pull/87570
148+
[rust#88023]: https://github.com/rust-lang/rust/pull/88023
149+
[rust#87760]: https://github.com/rust-lang/rust/pull/87760
150+
[rust#87370]: https://github.com/rust-lang/rust/pull/87370
151+
[rust#87580]: https://github.com/rust-lang/rust/pull/87580
152+
[rust#83342]: https://github.com/rust-lang/rust/pull/83342
153+
[rust#83093]: https://github.com/rust-lang/rust/pull/83093
154+
[rust#88177]: https://github.com/rust-lang/rust/pull/88177
155+
[rust#88548]: https://github.com/rust-lang/rust/pull/88548
156+
[rust#88551]: https://github.com/rust-lang/rust/pull/88551
157+
[rust#88299]: https://github.com/rust-lang/rust/pull/88299
158+
[rust#88220]: https://github.com/rust-lang/rust/pull/88220
159+
[rust#85835]: https://github.com/rust-lang/rust/pull/85835
160+
[rust#86879]: https://github.com/rust-lang/rust/pull/86879
161+
[rust#86744]: https://github.com/rust-lang/rust/pull/86744
162+
[rust#84662]: https://github.com/rust-lang/rust/pull/84662
163+
[rust#86593]: https://github.com/rust-lang/rust/pull/86593
164+
[rust#81050]: https://github.com/rust-lang/rust/pull/81050
165+
[rust#81363]: https://github.com/rust-lang/rust/pull/81363
166+
[rust#84111]: https://github.com/rust-lang/rust/pull/84111
167+
[rust#85769]: https://github.com/rust-lang/rust/pull/85769#issuecomment-854363720
168+
[rust#88490]: https://github.com/rust-lang/rust/pull/88490
169+
[rust#88269]: https://github.com/rust-lang/rust/pull/88269
170+
[rust#84176]: https://github.com/rust-lang/rust/pull/84176
171+
[rust#88399]: https://github.com/rust-lang/rust/pull/88399
172+
[rust#88227]: https://github.com/rust-lang/rust/pull/88227
173+
[rust#88200]: https://github.com/rust-lang/rust/pull/88200
174+
[rust#82776]: https://github.com/rust-lang/rust/pull/82776
175+
[rust#88077]: https://github.com/rust-lang/rust/pull/88077
176+
[rust#87728]: https://github.com/rust-lang/rust/pull/87728
177+
[rust#87050]: https://github.com/rust-lang/rust/pull/87050
178+
[rust#87619]: https://github.com/rust-lang/rust/pull/87619
179+
[rust#81825]: https://github.com/rust-lang/rust/pull/81825#issuecomment-808406918
180+
[rust#88019]: https://github.com/rust-lang/rust/pull/88019
181+
[rust#87666]: https://github.com/rust-lang/rust/pull/87666
182+
1183
Version 1.55.0 (2021年09月09日)
2184
============================
3185

@@ -4985,7 +5167,7 @@ Libraries
49855167
- [Upgrade to Unicode 10.0.0][42999]
49865168
- [Reimplemented `{f32, f64}::{min, max}` in Rust instead of using CMath.][42430]
49875169
- [Skip the main thread's manual stack guard on Linux][43072]
4988-
- [Iterator::nth for `ops::{Range, RangeFrom}` is now done in O(1) time][43077]
5170+
- [Iterator::nth for `ops::{Range, RangeFrom}` is now done in *O*(1) time][43077]
49895171
- [`#[repr(align(N))]` attribute max number is now 2^31 - 1.][43097] This was
49905172
previously 2^15.
49915173
- [`{OsStr, Path}::Display` now avoids allocations where possible][42613]
@@ -8288,7 +8470,7 @@ Libraries
82888470
algorithm][s].
82898471
* [`std::io::copy` allows `?Sized` arguments][cc].
82908472
* The `Windows`, `Chunks`, and `ChunksMut` iterators over slices all
8291-
[override `count`, `nth` and `last` with an O(1)
8473+
[override `count`, `nth` and `last` with an *O*(1)
82928474
implementation][it].
82938475
* [`Default` is implemented for arrays up to `[T; 32]`][d].
82948476
* [`IntoRawFd` has been added to the Unix-specific prelude,
@@ -8810,7 +8992,7 @@ Libraries
88108992
* The `Default` implementation for `Arc` [no longer requires `Sync +
88118993
Send`][arc].
88128994
* [The `Iterator` methods `count`, `nth`, and `last` have been
8813-
overridden for slices to have O(1) performance instead of O(n)][si].
8995+
overridden for slices to have *O*(1) performance instead of *O*(*n*)][si].
88148996
* Incorrect handling of paths on Windows has been improved in both the
88158997
compiler and the standard library.
88168998
* [`AtomicPtr` gained a `Default` implementation][ap].

‎src/ci/channel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
beta
1+
stable

‎src/librustdoc/visit_ast.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,21 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
8686
// the rexport defines the path that a user will actually see. Accordingly,
8787
// we add the rexport as an item here, and then skip over the original
8888
// definition in `visit_item()` below.
89+
//
90+
// We also skip `#[macro_export] macro_rules!` that have already been inserted,
91+
// it can happen if within the same module a `#[macro_export] macro_rules!`
92+
// is declared but also a reexport of itself producing two exports of the same
93+
// macro in the same module.
94+
let mut inserted = FxHashSet::default();
8995
for export in self.cx.tcx.module_exports(CRATE_DEF_ID).unwrap_or(&[]) {
9096
if let Res::Def(DefKind::Macro(_), def_id) = export.res {
9197
if let Some(local_def_id) = def_id.as_local() {
9298
if self.cx.tcx.has_attr(def_id, sym::macro_export) {
93-
let hir_id = self.cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
94-
let item = self.cx.tcx.hir().expect_item(hir_id);
95-
top_level_module.items.push((item, None));
99+
if inserted.insert(def_id) {
100+
let hir_id = self.cx.tcx.hir().local_def_id_to_hir_id(local_def_id);
101+
let item = self.cx.tcx.hir().expect_item(hir_id);
102+
top_level_module.items.push((item, None));
103+
}
96104
}
97105
}
98106
}

‎src/test/rustdoc-json/reexport/macro.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @count macro.json "$.index[*][?(@.name=='macro')].inner.items[*]" 2
7+
8+
// @set repro_id = macro.json "$.index[*][?(@.name=='repro')].id"
9+
// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro_id
10+
#[macro_export]
11+
macro_rules! repro {
12+
() => {};
13+
}
14+
15+
// @set repro2_id = macro.json "$.index[*][?(@.inner.name=='repro2')].id"
16+
// @has - "$.index[*][?(@.name=='macro')].inner.items[*]" $repro2_id
17+
pub use crate::repro as repro2;

‎src/test/rustdoc/issue-89852.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// edition:2018
2+
3+
#![no_core]
4+
#![feature(no_core)]
5+
6+
// @matches 'issue_89852/sidebar-items.js' '"repro"'
7+
// @!matches 'issue_89852/sidebar-items.js' '"repro".*"repro"'
8+
9+
#[macro_export]
10+
macro_rules! repro {
11+
() => {};
12+
}
13+
14+
pub use crate::repro as repro2;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /