From 49bcee8997cf0c21f6c85ecb193dd6910fe301e3 Mon Sep 17 00:00:00 2001
From: Pietro Albini
Date: Mon, 26 Jul 2021 12:41:43 +0200
Subject: [PATCH 01/10] switch to the stable channel
---
src/ci/channel | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/ci/channel b/src/ci/channel
index 65b2df87f7df3..2bf5ad0447d33 100644
--- a/src/ci/channel
+++ b/src/ci/channel
@@ -1 +1 @@
-beta
+stable
From 26210a3558e1bd78c94376d90c5bf9e07d932511 Mon Sep 17 00:00:00 2001
From: Erin Power
Date: Mon, 26 Jul 2021 12:45:13 +0200
Subject: [PATCH 02/10] update release notes to 1.54.0
---
RELEASES.md | 143 +++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 129 insertions(+), 14 deletions(-)
diff --git a/RELEASES.md b/RELEASES.md
index ced712ffb530b..36d6a5276f227 100644
--- a/RELEASES.md
+++ b/RELEASES.md
@@ -1,3 +1,127 @@
+Version 1.54.0 (2021-07-29)
+============================
+
+Language
+-----------------------
+
+- [You can now use macros for values in built-in attribute macros.][83366]
+ While a seemingly minor addition on its own, this enables a lot of
+ powerful functionality when combined correctly. Most notably you can
+ now include external documentation in your crate by writing the following.
+ ```rust
+ #![doc = include_str!("README.md")]
+ ```
+ You can also use this to include auto-generated modules:
+ ```rust
+ #[path = concat!(env!("OUT_DIR"), "/generated.rs")]
+ mod generated;
+ ```
+
+- [You can now cast between unsized slice types (and types which contain
+ unsized slices) in `const fn`.][85078]
+- [You can now use multiple generic lifetimes with `impl Trait` where the
+ lifetimes don't explicitly outlive another.][84701] In code this means
+ that you can now have `impl Trait<'a, 'b>` where as before you could
+ only have `impl Trait<'a, 'b> where 'b: 'a`.
+
+Compiler
+-----------------------
+
+- [Rustc will now search for custom JSON targets in
+ `/lib/rustlib//target.json` where `/` is the "sysroot"
+ directory.][83800] You can find your sysroot directory by running
+ `rustc --print sysroot`.
+- [Added `wasm` as a `target_family` for WebAssembly platforms.][84072]
+- [You can now use `#[target_feature]` on safe functions when targeting
+ WebAssembly platforms.][84988]
+- [Improved debugger output for enums on Windows MSVC platforms.][85292]
+- [Added tier 3\* support for `bpfel-unknown-none`
+ and `bpfeb-unknown-none`.][79608]
+
+\* Refer to Rust's [platform support page][platform-support-doc] for more
+ information on Rust's tiered platform support.
+
+Libraries
+-----------------------
+
+- [`panic::panic_any` will now `#[track_caller]`.][85745]
+- [Added `OutOfMemory` as a variant of `io::ErrorKind`.][84744]
+- [ `proc_macro::Literal` now implements `FromStr`.][84717]
+- [The implementations of vendor intrinsics in core::arch have been
+ significantly refactored.][83278] The main user-visible changes are
+ a 50% reduction in the size of libcore.rlib and stricter validation
+ of constant operands passed to intrinsics. The latter is technically
+ a breaking change, but allows Rust to more closely match the C vendor
+ intrinsics API.
+
+Stabilized APIs
+---------------
+
+- [`BTreeMap::into_keys`]
+- [`BTreeMap::into_values`]
+- [`HashMap::into_keys`]
+- [`HashMap::into_values`]
+- [`arch::wasm32`]
+- [`VecDeque::binary_search`]
+- [`VecDeque::binary_search_by`]
+- [`VecDeque::binary_search_by_key`]
+- [`VecDeque::partition_point`]
+
+Cargo
+-----
+
+- [Added the `--prune ` option to `cargo-tree` to remove a package from
+ the dependency graph.][cargo/9520]
+- [Added the `--depth` option to `cargo-tree` to print only to a certain depth
+ in the tree ][cargo/9499]
+- [Added the `no-proc-macro` value to `cargo-tree --edges` to hide procedural
+ macro dependencies.][cargo/9488]
+- [A new environment variable named `CARGO_TARGET_TMPDIR` is available.][cargo/9375]
+ This variable points to a directory that integration tests and benches
+ can use as a "scratchpad" for testing filesystem operations.
+
+Compatibility Notes
+-------------------
+- [Mixing Option and Result via `?` is no longer permitted in closures for inferred types.][86831]
+- [Previously unsound code is no longer permitted where different constructors in branches
+ could require different lifetimes.][85574]
+- As previously mentioned the [`std::arch` instrinsics now uses stricter const checking][83278]
+ than before and may reject some previously accepted code.
+- [`i128` multiplication on Cortex M0+ platforms currently unconditionally causes overflow
+ when compiled with `codegen-units = 1`.][86063]
+
+[85574]: https://github.com/rust-lang/rust/issues/85574
+[86831]: https://github.com/rust-lang/rust/issues/86831
+[86063]: https://github.com/rust-lang/rust/issues/86063
+[86831]: https://github.com/rust-lang/rust/issues/86831
+[79608]: https://github.com/rust-lang/rust/pull/79608
+[84988]: https://github.com/rust-lang/rust/pull/84988
+[84701]: https://github.com/rust-lang/rust/pull/84701
+[84072]: https://github.com/rust-lang/rust/pull/84072
+[85745]: https://github.com/rust-lang/rust/pull/85745
+[84744]: https://github.com/rust-lang/rust/pull/84744
+[85078]: https://github.com/rust-lang/rust/pull/85078
+[84717]: https://github.com/rust-lang/rust/pull/84717
+[83800]: https://github.com/rust-lang/rust/pull/83800
+[83366]: https://github.com/rust-lang/rust/pull/83366
+[83278]: https://github.com/rust-lang/rust/pull/83278
+[85292]: https://github.com/rust-lang/rust/pull/85292
+[cargo/9520]: https://github.com/rust-lang/cargo/pull/9520
+[cargo/9499]: https://github.com/rust-lang/cargo/pull/9499
+[cargo/9488]: https://github.com/rust-lang/cargo/pull/9488
+[cargo/9375]: https://github.com/rust-lang/cargo/pull/9375
+[`BTreeMap::into_keys`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.into_keys
+[`BTreeMap::into_values`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.into_values
+[`HashMap::into_keys`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.into_keys
+[`HashMap::into_values`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html#method.into_values
+[`arch::wasm32`]: https://doc.rust-lang.org/core/arch/wasm32/index.html
+[`VecDeque::binary_search`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.binary_search
+[`VecDeque::binary_search_by`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.binary_search_by
+
+[`VecDeque::binary_search_by_key`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.binary_search_by_key
+
+[`VecDeque::partition_point`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.partition_point
+
Version 1.53.0 (2021-06-17)
============================
@@ -81,13 +205,6 @@ Stabilised APIs
- [`Vec::extend_from_within`]
- [`array::from_mut`]
- [`array::from_ref`]
-- [`char::MAX`]
-- [`char::REPLACEMENT_CHARACTER`]
-- [`char::UNICODE_VERSION`]
-- [`char::decode_utf16`]
-- [`char::from_digit`]
-- [`char::from_u32_unchecked`]
-- [`char::from_u32`]
- [`cmp::max_by_key`]
- [`cmp::max_by`]
- [`cmp::min_by_key`]
@@ -120,6 +237,7 @@ Compatibility Notes
In particular, this was known to be a problem in the `lexical-core` crate,
but they have published fixes for semantic versions 0.4 through 0.7. To
update this dependency alone, use `cargo update -p lexical-core`.
+- Incremental compilation remains off by default, unless one uses the `RUSTC_FORCE_INCREMENTAL=1` environment variable added in 1.52.1.
Internal Only
-------------
@@ -156,13 +274,6 @@ related tools.
[cargo/9298]: https://github.com/rust-lang/cargo/pull/9298
[cargo/9282]: https://github.com/rust-lang/cargo/pull/9282
[cargo/9392]: https://github.com/rust-lang/cargo/pull/9392
-[`char::MAX`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.MAX
-[`char::REPLACEMENT_CHARACTER`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.REPLACEMENT_CHARACTER
-[`char::UNICODE_VERSION`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.UNICODE_VERSION
-[`char::decode_utf16`]: https://doc.rust-lang.org/std/primitive.char.html#method.decode_utf16
-[`char::from_u32`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_u32
-[`char::from_u32_unchecked`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_u32_unchecked
-[`char::from_digit`]: https://doc.rust-lang.org/std/primitive.char.html#method.from_digit
[`AtomicBool::fetch_update`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicBool.html#method.fetch_update
[`AtomicPtr::fetch_update`]: https://doc.rust-lang.org/std/sync/atomic/struct.AtomicPtr.html#method.fetch_update
[`BTreeMap::retain`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html#method.retain
@@ -324,6 +435,7 @@ Compatibility Notes
- [Rustc now catches more cases of `pub_use_of_private_extern_crate`][80763]
- [Changes in how proc macros handle whitespace may lead to panics when used
with older `proc-macro-hack` versions. A `cargo update` should be sufficient to fix this in all cases.][84136]
+- [Turn `#[derive]` into a regular macro attribute][79078]
[84136]: https://github.com/rust-lang/rust/issues/84136
[80763]: https://github.com/rust-lang/rust/pull/80763
@@ -350,6 +462,7 @@ Compatibility Notes
[78429]: https://github.com/rust-lang/rust/pull/78429
[82733]: https://github.com/rust-lang/rust/pull/82733
[82594]: https://github.com/rust-lang/rust/pull/82594
+[79078]: https://github.com/rust-lang/rust/pull/79078
[cargo/9181]: https://github.com/rust-lang/cargo/pull/9181
[`char::MAX`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.MAX
[`char::REPLACEMENT_CHARACTER`]: https://doc.rust-lang.org/std/primitive.char.html#associatedconstant.REPLACEMENT_CHARACTER
@@ -1760,6 +1873,7 @@ Language
- [You can now use `#[repr(transparent)]` on univariant `enum`s.][68122] Meaning
that you can create an enum that has the exact layout and ABI of the type
it contains.
+- [You can now use outer attribute procedural macros on inline modules.][64273]
- [There are some *syntax-only* changes:][67131]
- `default` is syntactically allowed before items in `trait` definitions.
- Items in `impl`s (i.e. `const`s, `type`s, and `fn`s) may syntactically
@@ -1821,6 +1935,7 @@ Compatibility Notes
[67935]: https://github.com/rust-lang/rust/pull/67935/
[68339]: https://github.com/rust-lang/rust/pull/68339/
[68122]: https://github.com/rust-lang/rust/pull/68122/
+[64273]: https://github.com/rust-lang/rust/pull/64273/
[67712]: https://github.com/rust-lang/rust/pull/67712/
[67887]: https://github.com/rust-lang/rust/pull/67887/
[67131]: https://github.com/rust-lang/rust/pull/67131/
From e722a08eb8b151a34755495e7ca4438b0a46ed81 Mon Sep 17 00:00:00 2001
From: Guillaume Gomez
Date: Thu, 15 Jul 2021 22:06:53 +0200
Subject: [PATCH 03/10] Do not hide the sidebar on mobile, move it outside of
the viewport instead
---
src/librustdoc/html/static/rustdoc.css | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index d8684641a3045..b88e4ac5c28e5 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -1577,15 +1577,18 @@ details.undocumented[open] > summary::before {
display: none;
}
+ /* We do NOT hide this element so that alternative device readers still have this information
+ available. */
.sidebar-elems {
position: fixed;
z-index: 1;
- left: 0;
top: 45px;
bottom: 0;
+ width: 246px;
+ /* We move the sidebar to the left by its own width so it doesn't appear. */
+ left: -246px;
overflow-y: auto;
border-right: 1px solid;
- display: none;
}
.sidebar > .block.version {
@@ -1662,8 +1665,7 @@ details.undocumented[open] > summary::before {
}
.show-it {
- display: block;
- width: 246px;
+ left: 0;
}
.show-it > .block.items {
From 2818e74c38507525938aaa639eb7ad23f0b03efb Mon Sep 17 00:00:00 2001
From: Guillaume Gomez
Date: Thu, 15 Jul 2021 22:12:28 +0200
Subject: [PATCH 04/10] Add test for sidebar display value on mobile
---
src/test/rustdoc-gui/sidebar-mobile.goml | 10 ++++++++++
1 file changed, 10 insertions(+)
create mode 100644 src/test/rustdoc-gui/sidebar-mobile.goml
diff --git a/src/test/rustdoc-gui/sidebar-mobile.goml b/src/test/rustdoc-gui/sidebar-mobile.goml
new file mode 100644
index 0000000000000..9a1442e48a9ea
--- /dev/null
+++ b/src/test/rustdoc-gui/sidebar-mobile.goml
@@ -0,0 +1,10 @@
+// This test ensure that the sidebar isn't "hidden" on mobile but instead moved out of the viewport.
+// This is especially important for devices for "text-first" content (like for users with
+// sight issues).
+goto: file://|DOC_PATH|/test_docs/struct.Foo.html
+// Switching to "mobile view" by reducing the width to 600px.
+size: (600, 600)
+assert-css: (".sidebar-elems", {"display": "block", "left": "-246px"})
+// Opening the sidebar menu.
+click: ".sidebar-menu"
+assert-css: (".sidebar-elems", {"display": "block", "left": "0px"})
From 0a297ac47d03588d63ed31b025120e4cb0199930 Mon Sep 17 00:00:00 2001
From: Michael Howell
Date: Fri, 16 Jul 2021 21:58:23 -0700
Subject: [PATCH 05/10] Rustdoc accessibility: make the sidebar headers actual
headers
Part of #87059
Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
---
src/librustdoc/html/render/context.rs | 4 +-
src/librustdoc/html/render/mod.rs | 54 +++++++++++++-------------
src/librustdoc/html/static/rustdoc.css | 5 +++
3 files changed, 34 insertions(+), 29 deletions(-)
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index 1898f5feed2cd..84c5b5dd60466 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -527,7 +527,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
};
let sidebar = if let Some(ref version) = self.cache.crate_version {
format!(
- "Crate {}
\
+ "Crate {}
\
\
@@ -554,7 +554,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
page.root_path = "./";
let mut style_files = self.shared.style_files.clone();
- let sidebar = "Settings
";
+ let sidebar = "Settings
";
style_files.push(StylePath { path: PathBuf::from("settings.css"), disabled: false });
let v = layout::render(
&self.shared.layout,
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index 53112c87fdc61..5022ed9fc7b37 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -1690,7 +1690,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
{
write!(
buffer,
- "{}{}
",
+ "{}{}
",
match *it.kind {
clean::StructItem(..) => "Struct ",
clean::TraitItem(..) => "Trait ",
@@ -1753,7 +1753,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
// to navigate the documentation (though slightly inefficiently).
if !it.is_mod() {
- buffer.write_str("Other items in
");
+ buffer.write_str("
Other items in
");
for (i, name) in cx.current.iter().take(parentlen).enumerate() {
if i > 0 {
buffer.write_str("::");
@@ -1765,7 +1765,7 @@ fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buffer) {
*name
);
}
- buffer.write_str("
");
+ buffer.write_str("");
}
// Sidebar refers to the enclosing module, not this module.
@@ -1876,7 +1876,7 @@ fn sidebar_assoc_items(cx: &Context<'_>, out: &mut Buffer, it: &clean::Item) {
ret.sort();
out.push_str(
- "\
+ "\