Skip to content

Commit

Permalink
Auto merge of rust-lang#87508 - pietroalbini:beta-next, r=Mark-Simula…
Browse files Browse the repository at this point in the history
…crum

Prepare beta 1.55.0

Included backports:

* rust-lang#86696
* rust-lang#87390 (squashed)

Reverted:

* rust-lang#86623

cc `@rust-lang/release` `@Mark-Simulacrum`
  • Loading branch information
bors committed Jul 28, 2021
2 parents d03456d + 87d2c59 commit 739f8f0
Show file tree
Hide file tree
Showing 88 changed files with 403 additions and 280 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ jobs:
env:
IMAGE: x86_64-gnu
RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
CI_ONLY_WHEN_CHANNEL: nightly
os: ubuntu-latest-xl
- name: x86_64-gnu-aux
os: ubuntu-latest-xl
Expand Down
126 changes: 125 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -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-triple>/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 <spec>` 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)
============================

Expand Down Expand Up @@ -1749,7 +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]
- [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
Expand Down
2 changes: 1 addition & 1 deletion src/ci/channel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly
beta
2 changes: 0 additions & 2 deletions src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/

ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
Expand All @@ -38,7 +37,6 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
python3 ../x.py test --stage 2 src/tools/tidy && \
python3 ../x.py doc --stage 0 library/test && \
/scripts/validate-toolstate.sh && \
/scripts/validate-error-codes.sh && \
# Runs checks to ensure that there are no ES5 issues in our JS code.
es-check es5 ../src/librustdoc/html/static/js/*.js && \
eslint ../src/librustdoc/html/static/js/*.js
20 changes: 0 additions & 20 deletions src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh

This file was deleted.

9 changes: 0 additions & 9 deletions src/ci/docker/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,6 @@ else
command="/checkout/src/ci/run.sh"
fi

if [ "$CI" != "" ]; then
# Get some needed information for $BASE_COMMIT
git fetch "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF"
BASE_COMMIT="$(git merge-base FETCH_HEAD HEAD)"
else
BASE_COMMIT=""
fi

docker \
run \
--workdir /checkout/obj \
Expand All @@ -245,7 +237,6 @@ docker \
--env TOOLSTATE_PUBLISH \
--env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
--env BASE_COMMIT="$BASE_COMMIT" \
--init \
--rm \
rust-ci \
Expand Down
4 changes: 4 additions & 0 deletions src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@ jobs:
env:
IMAGE: x86_64-gnu
RUST_CI_OVERRIDE_RELEASE_CHANNEL: stable
# Only run this job on the nightly channel. Running this on beta
# could cause failures when `dev: 1` in `stage0.txt`, and running
# this on stable is useless.
CI_ONLY_WHEN_CHANNEL: nightly
<<: *job-linux-xl

- name: x86_64-gnu-aux
Expand Down
62 changes: 37 additions & 25 deletions src/ci/scripts/should-skip-this.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,43 @@ IFS=$'\n\t'

source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"

if [[ -z "${CI_ONLY_WHEN_SUBMODULES_CHANGED+x}" ]]; then
echo "Executing the job since there is no skip rule in effect"
exit 0
if [[ -n "${CI_ONLY_WHEN_SUBMODULES_CHANGED-}" ]]; then
git fetch "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF"
BASE_COMMIT="$(git merge-base FETCH_HEAD HEAD)"

echo "Searching for toolstate changes between $BASE_COMMIT and $(git rev-parse HEAD)"

if git diff "$BASE_COMMIT" | grep --quiet "^index .* 160000"; then
# Submodules pseudo-files inside git have the 160000 permissions, so when
# those files are present in the diff a submodule was updated.
echo "Submodules were updated"
elif ! git diff --quiet "$BASE_COMMIT" -- src/tools/clippy src/tools/rustfmt; then
# There is not an easy blanket search for subtrees. For now, manually list
# the subtrees.
echo "Clippy or rustfmt subtrees were updated"
elif ! (git diff --quiet "$BASE_COMMIT" -- \
src/test/rustdoc-gui \
src/librustdoc \
src/tools/rustdoc-gui); then
# There was a change in either rustdoc or in its GUI tests.
echo "Rustdoc was updated"
else
echo "Not executing this job since no submodules nor subtrees were updated"
ciCommandSetEnv SKIP_JOB 1
exit 0
fi
fi

git fetch "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_BASE_REF"
BASE_COMMIT="$(git merge-base FETCH_HEAD HEAD)"

echo "Searching for toolstate changes between $BASE_COMMIT and $(git rev-parse HEAD)"

if git diff "$BASE_COMMIT" | grep --quiet "^index .* 160000"; then
# Submodules pseudo-files inside git have the 160000 permissions, so when
# those files are present in the diff a submodule was updated.
echo "Executing the job since submodules are updated"
elif ! git diff --quiet "$BASE_COMMIT" -- src/tools/clippy src/tools/rustfmt; then
# There is not an easy blanket search for subtrees. For now, manually list
# the subtrees.
echo "Executing the job since clippy or rustfmt subtree was updated"
elif ! (git diff --quiet "$BASE_COMMIT" -- \
src/test/rustdoc-gui \
src/librustdoc \
src/tools/rustdoc-gui); then
# There was a change in either rustdoc or in its GUI tests.
echo "Executing the job since rustdoc was updated"
else
echo "Not executing this job since no submodules nor subtrees were updated"
ciCommandSetEnv SKIP_JOB 1
if [[ -n "${CI_ONLY_WHEN_CHANNEL-}" ]]; then
if [[ "${CI_ONLY_WHEN_CHANNEL}" = "$(cat src/ci/channel)" ]]; then
echo "The channel is the expected one"
else
echo "Not executing this job as the channel is not the expected one"
ciCommandSetEnv SKIP_JOB 1
exit 0
fi
fi


echo "Executing the job since there is no skip rule preventing the execution"
exit 0
22 changes: 11 additions & 11 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,7 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String {
if out.is_empty() {
write!(
&mut out,
"<h3 class=\"notable\">Notable traits for {}</h3>\
"<div class=\"notable\">Notable traits for {}</div>\
<code class=\"content\">",
impl_.for_.print(cx)
);
Expand Down Expand Up @@ -1350,15 +1350,15 @@ fn render_impl(
);
render_rightside(w, cx, item, containing_item);
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
w.write_str("<code>");
w.write_str("<h4 class=\"code-header\">");
render_assoc_item(
w,
item,
link.anchor(source_id.as_ref().unwrap_or(&id)),
ItemType::Impl,
cx,
);
w.write_str("</code>");
w.write_str("</h4>");
w.write_str("</div>");
}
}
Expand All @@ -1371,7 +1371,7 @@ fn render_impl(
id, item_type, in_trait_class
);
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
w.write_str("<code>");
w.write_str("<h4 class=\"code-header\">");
assoc_type(
w,
item,
Expand All @@ -1381,7 +1381,7 @@ fn render_impl(
"",
cx,
);
w.write_str("</code>");
w.write_str("</h4>");
w.write_str("</div>");
}
clean::AssocConstItem(ref ty, ref default) => {
Expand All @@ -1394,7 +1394,7 @@ fn render_impl(
);
render_rightside(w, cx, item, containing_item);
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
w.write_str("<code>");
w.write_str("<h4 class=\"code-header\">");
assoc_const(
w,
item,
Expand All @@ -1404,15 +1404,15 @@ fn render_impl(
"",
cx,
);
w.write_str("</code>");
w.write_str("</h4>");
w.write_str("</div>");
}
clean::AssocTypeItem(ref bounds, ref default) => {
let source_id = format!("{}.{}", item_type, name);
let id = cx.derive_id(source_id.clone());
write!(w, "<div id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class,);
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
w.write_str("<code>");
w.write_str("<h4 class=\"code-header\">");
assoc_type(
w,
item,
Expand All @@ -1422,7 +1422,7 @@ fn render_impl(
"",
cx,
);
w.write_str("</code>");
w.write_str("</h4>");
w.write_str("</div>");
}
clean::StrippedItem(..) => return,
Expand Down Expand Up @@ -1613,7 +1613,7 @@ pub(crate) fn render_impl_summary(
write!(w, "<div id=\"{}\" class=\"impl has-srclink\"{}>", id, aliases);
render_rightside(w, cx, &i.impl_item, containing_item);
write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id);
write!(w, "<code class=\"in-band\">");
write!(w, "<h3 class=\"code-header in-band\">");

if let Some(use_absolute) = use_absolute {
write!(w, "{}", i.inner_impl().print(use_absolute, cx));
Expand All @@ -1629,7 +1629,7 @@ pub(crate) fn render_impl_summary(
} else {
write!(w, "{}", i.inner_impl().print(false, cx));
}
write!(w, "</code>");
write!(w, "</h3>");

let is_trait = i.inner_impl().trait_.is_some();
if is_trait {
Expand Down
4 changes: 2 additions & 2 deletions src/librustdoc/html/render/print_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,9 +621,9 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra
render_stability_since(w, m, t, cx.tcx());
write_srclink(cx, m, w);
write!(w, "</div>");
write!(w, "<code>");
write!(w, "<h4 class=\"code-header\">");
render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl, cx);
w.write_str("</code>");
w.write_str("</h4>");
w.write_str("</div>");
if toggled {
write!(w, "</summary>");
Expand Down
Loading

0 comments on commit 739f8f0

Please sign in to comment.