Skip to content

Commit 0cfb2f7

Browse files
committed
Auto merge of #63074 - Centril:rollup-k1a8z0n, r=Centril
Rollup of 8 pull requests Successful merges: - #62550 (Implement RFC 2707 + Parser recovery for range patterns) - #62759 (Actually add rustc-guide to toolstate, don't fail builds for the guide) - #62806 (Fix few Clippy warnings) - #62974 (bump crossbeam-epoch dependency) - #63051 (Avoid ICE when referencing desugared local binding in borrow error) - #63061 (In which we constantly improve the Vec(Deque) array PartialEq impls) - #63067 (Add test for issue-50900) - #63071 (Allow rustbot to add `F-*` + `requires-nightly`.) Failed merges: r? @ghost
2 parents 9a239ef + 370aa19 commit 0cfb2f7

File tree

113 files changed

+1884
-775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1884
-775
lines changed

Cargo.lock

+20-5
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ name = "crossbeam-deque"
590590
version = "0.6.3"
591591
source = "registry+https://github.com/rust-lang/crates.io-index"
592592
dependencies = [
593-
"crossbeam-epoch 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
593+
"crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
594594
"crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
595595
]
596596

@@ -610,15 +610,15 @@ dependencies = [
610610

611611
[[package]]
612612
name = "crossbeam-epoch"
613-
version = "0.7.0"
613+
version = "0.7.2"
614614
source = "registry+https://github.com/rust-lang/crates.io-index"
615615
dependencies = [
616616
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
617617
"cfg-if 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
618618
"crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
619619
"lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
620-
"memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
621-
"scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
620+
"memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
621+
"scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
622622
]
623623

624624
[[package]]
@@ -1671,6 +1671,14 @@ name = "memoffset"
16711671
version = "0.2.1"
16721672
source = "registry+https://github.com/rust-lang/crates.io-index"
16731673

1674+
[[package]]
1675+
name = "memoffset"
1676+
version = "0.5.1"
1677+
source = "registry+https://github.com/rust-lang/crates.io-index"
1678+
dependencies = [
1679+
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
1680+
]
1681+
16741682
[[package]]
16751683
name = "mime"
16761684
version = "0.3.13"
@@ -3298,6 +3306,11 @@ name = "scopeguard"
32983306
version = "0.3.3"
32993307
source = "registry+https://github.com/rust-lang/crates.io-index"
33003308

3309+
[[package]]
3310+
name = "scopeguard"
3311+
version = "1.0.0"
3312+
source = "registry+https://github.com/rust-lang/crates.io-index"
3313+
33013314
[[package]]
33023315
name = "security-framework"
33033316
version = "0.3.1"
@@ -4316,7 +4329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
43164329
"checksum crossbeam-deque 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f739f8c5363aca78cfb059edf753d8f0d36908c348f3d8d1503f03d8b75d9cf3"
43174330
"checksum crossbeam-deque 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "05e44b8cf3e1a625844d1750e1f7820da46044ff6d28f4d43e455ba3e5bb2c13"
43184331
"checksum crossbeam-epoch 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "927121f5407de9956180ff5e936fe3cf4324279280001cd56b669d28ee7e9150"
4319-
"checksum crossbeam-epoch 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f10a4f8f409aaac4b16a5474fb233624238fcdeefb9ba50d5ea059aab63ba31c"
4332+
"checksum crossbeam-epoch 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9"
43204333
"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b"
43214334
"checksum crossbeam-utils 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2760899e32a1d58d5abb31129f8fae5de75220bc2176e77ff7c627ae45c918d9"
43224335
"checksum crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c"
@@ -4426,6 +4439,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
44264439
"checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
44274440
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
44284441
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
4442+
"checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f"
44294443
"checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425"
44304444
"checksum mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed"
44314445
"checksum minifier 0.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "4c909e78edf61f3aa0dd2086da168cdf304329044bbf248768ca3d20253ec8c0"
@@ -4528,6 +4542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
45284542
"checksum scoped-tls 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
45294543
"checksum scoped_threadpool 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
45304544
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
4545+
"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
45314546
"checksum security-framework 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eee63d0f4a9ec776eeb30e220f0bc1e092c3ad744b2a379e3993070364d3adc2"
45324547
"checksum security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9636f8989cbf61385ae4824b98c1aaa54c994d7d8b41f11c601ed799f0549a56"
45334548
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"

src/ci/docker/x86_64-gnu-tools/checkregression.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
## This script has two purposes: detect any tool that *regressed*, which is used
5+
## during the week before the beta branches to reject PRs; and detect any tool
6+
## that *changed* to see if we need to update the toolstate repo.
7+
48
import sys
59
import json
610

11+
# Regressions for these tools during the beta cutoff week do not cause failure.
12+
# See `status_check` in `checktools.sh` for tools that have to pass on the
13+
# beta/stable branches.
14+
REGRESSION_OK = ["rustc-guide", "miri", "embedded-book"]
15+
716
if __name__ == '__main__':
817
os_name = sys.argv[1]
918
toolstate_file = sys.argv[2]
@@ -32,7 +41,8 @@
3241
'The state of "{}" has {} from "{}" to "{}"'
3342
.format(tool, verb, state, new_state)
3443
)
35-
regressed = True
44+
if not (verb == 'regressed' and tool in REGRESSION_OK):
45+
regressed = True
3646

3747
if regressed:
3848
sys.exit(1)

src/ci/docker/x86_64-gnu-tools/checktools.sh

+15-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ python2.7 "$X_PY" test --no-fail-fast \
2525
src/doc/rust-by-example \
2626
src/doc/embedded-book \
2727
src/doc/edition-guide \
28+
src/doc/rustc-guide \
2829
src/tools/clippy \
2930
src/tools/rls \
3031
src/tools/rustfmt \
@@ -41,7 +42,7 @@ check_tool_failed() {
4142
}
4243

4344
# This function checks that if a tool's submodule changed, the tool's state must improve
44-
verify_status() {
45+
verify_submodule_changed() {
4546
echo "Verifying status of $1..."
4647
if echo "$CHANGED_FILES" | grep -q "^M[[:blank:]]$2$"; then
4748
echo "This PR updated '$2', verifying if status is 'test-pass'..."
@@ -66,7 +67,7 @@ verify_status() {
6667
check_dispatch() {
6768
if [ "$1" = submodule_changed ]; then
6869
# ignore $2 (branch id)
69-
verify_status $3 $4
70+
verify_submodule_changed $3 $4
7071
elif [ "$2" = beta ]; then
7172
echo "Requiring test passing for $3..."
7273
if check_tool_failed "$3"; then
@@ -75,7 +76,12 @@ check_dispatch() {
7576
fi
7677
}
7778

78-
# list all tools here
79+
# List all tools here.
80+
# This function gets called with "submodule_changed" for each PR that changed a submodule,
81+
# and with "beta_required" for each PR that lands on beta/stable.
82+
# The purpose of this function is to *reject* PRs if a tool is not "test-pass" and
83+
# (a) the tool's submodule has been updated, or (b) we landed on beta/stable and the
84+
# tool has to "test-pass" on that branch.
7985
status_check() {
8086
check_dispatch $1 beta book src/doc/book
8187
check_dispatch $1 beta nomicon src/doc/nomicon
@@ -85,7 +91,10 @@ status_check() {
8591
check_dispatch $1 beta rls src/tools/rls
8692
check_dispatch $1 beta rustfmt src/tools/rustfmt
8793
check_dispatch $1 beta clippy-driver src/tools/clippy
88-
# these tools are not required for beta to successfully branch
94+
# These tools are not required on the beta/stable branches, but they *do* cause
95+
# PRs to fail if a submodule update does not fix them.
96+
# They will still cause failure during the beta cutoff week, unless `checkregression.py`
97+
# exempts them from that.
8998
check_dispatch $1 nightly miri src/tools/miri
9099
check_dispatch $1 nightly embedded-book src/doc/embedded-book
91100
check_dispatch $1 nightly rustc-guide src/doc/rustc-guide
@@ -97,12 +106,14 @@ status_check() {
97106
status_check "submodule_changed"
98107

99108
CHECK_NOT="$(readlink -f "$(dirname $0)/checkregression.py")"
109+
# This callback is called by `commit_toolstate_change`, see `repo.sh`.
100110
change_toolstate() {
101111
# only update the history
102112
if python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" changed; then
103113
echo 'Toolstate is not changed. Not updating.'
104114
else
105115
if [ $SIX_WEEK_CYCLE -ge 35 ]; then
116+
# Reject any regressions during the week before beta cutoff.
106117
python2.7 "$CHECK_NOT" "$OS" "$TOOLSTATE_FILE" "_data/latest.json" regressed
107118
fi
108119
sed -i "1 a\\

src/ci/docker/x86_64-gnu-tools/repo.sh

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@ commit_toolstate_change() {
4242
MESSAGE_FILE="$1"
4343
shift
4444
for RETRY_COUNT in 1 2 3 4 5; do
45+
# Call the callback.
46+
# - If we are in the `auto` branch (pre-landing), this is called from `checktools.sh` and
47+
# the callback is `change_toolstate` in that file. The purpose of this is to publish the
48+
# test results (the new commit-to-toolstate mapping) in the toolstate repo.
49+
# - If we are in the `master` branch (post-landing), this is called by the CI pipeline
50+
# and the callback is `src/tools/publish_toolstate.py`. The purpose is to publish
51+
# the new "current" toolstate in the toolstate repo.
4552
"$@"
4653
# `git commit` failing means nothing to commit.
4754
FAILURE=0

src/doc/unstable-book/src/language-features/slice-patterns.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ matched against that pattern. For example:
1717
fn is_symmetric(list: &[u32]) -> bool {
1818
match list {
1919
&[] | &[_] => true,
20-
&[x, ref inside.., y] if x == y => is_symmetric(inside),
20+
&[x, ref inside @ .., y] if x == y => is_symmetric(inside),
2121
&[..] => false,
2222
}
2323
}

src/liballoc/collections/btree/map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<K: Clone, V: Clone> Clone for BTreeMap<K, V> {
200200
}
201201
}
202202

203-
if self.len() == 0 {
203+
if self.is_empty() {
204204
// Ideally we'd call `BTreeMap::new` here, but that has the `K:
205205
// Ord` constraint, which this method lacks.
206206
BTreeMap {
@@ -759,12 +759,12 @@ impl<K: Ord, V> BTreeMap<K, V> {
759759
#[stable(feature = "btree_append", since = "1.11.0")]
760760
pub fn append(&mut self, other: &mut Self) {
761761
// Do we have to append anything at all?
762-
if other.len() == 0 {
762+
if other.is_empty() {
763763
return;
764764
}
765765

766766
// We can just swap `self` and `other` if `self` is empty.
767-
if self.len() == 0 {
767+
if self.is_empty() {
768768
mem::swap(self, other);
769769
return;
770770
}

src/liballoc/collections/linked_list.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ impl<T> LinkedList<T> {
237237

238238
// Not creating new mutable (unique!) references overlapping `element`.
239239
match node.prev {
240-
Some(prev) => (*prev.as_ptr()).next = node.next.clone(),
240+
Some(prev) => (*prev.as_ptr()).next = node.next,
241241
// this node is the head node
242-
None => self.head = node.next.clone(),
242+
None => self.head = node.next,
243243
};
244244

245245
match node.next {
246-
Some(next) => (*next.as_ptr()).prev = node.prev.clone(),
246+
Some(next) => (*next.as_ptr()).prev = node.prev,
247247
// this node is the tail node
248-
None => self.tail = node.prev.clone(),
248+
None => self.tail = node.prev,
249249
};
250250

251251
self.len -= 1;

src/liballoc/collections/vec_deque.rs

+14-26
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
1010
#![stable(feature = "rust1", since = "1.0.0")]
1111

12+
use core::array::LengthAtMost32;
1213
use core::cmp::{self, Ordering};
1314
use core::fmt;
1415
use core::iter::{repeat_with, FromIterator, FusedIterator};
@@ -2571,13 +2572,14 @@ impl<A: PartialEq> PartialEq for VecDeque<A> {
25712572
impl<A: Eq> Eq for VecDeque<A> {}
25722573

25732574
macro_rules! __impl_slice_eq1 {
2574-
($Lhs: ty, $Rhs: ty) => {
2575-
__impl_slice_eq1! { $Lhs, $Rhs, Sized }
2576-
};
2577-
($Lhs: ty, $Rhs: ty, $Bound: ident) => {
2575+
([$($vars:tt)*] $lhs:ty, $rhs:ty, $($constraints:tt)*) => {
25782576
#[stable(feature = "vec_deque_partial_eq_slice", since = "1.17.0")]
2579-
impl<A: $Bound, B> PartialEq<$Rhs> for $Lhs where A: PartialEq<B> {
2580-
fn eq(&self, other: &$Rhs) -> bool {
2577+
impl<A, B, $($vars)*> PartialEq<$rhs> for $lhs
2578+
where
2579+
A: PartialEq<B>,
2580+
$($constraints)*
2581+
{
2582+
fn eq(&self, other: &$rhs) -> bool {
25812583
if self.len() != other.len() {
25822584
return false;
25832585
}
@@ -2589,26 +2591,12 @@ macro_rules! __impl_slice_eq1 {
25892591
}
25902592
}
25912593

2592-
__impl_slice_eq1! { VecDeque<A>, Vec<B> }
2593-
__impl_slice_eq1! { VecDeque<A>, &[B] }
2594-
__impl_slice_eq1! { VecDeque<A>, &mut [B] }
2595-
2596-
macro_rules! array_impls {
2597-
($($N: expr)+) => {
2598-
$(
2599-
__impl_slice_eq1! { VecDeque<A>, [B; $N] }
2600-
__impl_slice_eq1! { VecDeque<A>, &[B; $N] }
2601-
__impl_slice_eq1! { VecDeque<A>, &mut [B; $N] }
2602-
)+
2603-
}
2604-
}
2605-
2606-
array_impls! {
2607-
0 1 2 3 4 5 6 7 8 9
2608-
10 11 12 13 14 15 16 17 18 19
2609-
20 21 22 23 24 25 26 27 28 29
2610-
30 31 32
2611-
}
2594+
__impl_slice_eq1! { [] VecDeque<A>, Vec<B>, }
2595+
__impl_slice_eq1! { [] VecDeque<A>, &[B], }
2596+
__impl_slice_eq1! { [] VecDeque<A>, &mut [B], }
2597+
__impl_slice_eq1! { [const N: usize] VecDeque<A>, [B; N], [B; N]: LengthAtMost32 }
2598+
__impl_slice_eq1! { [const N: usize] VecDeque<A>, &[B; N], [B; N]: LengthAtMost32 }
2599+
__impl_slice_eq1! { [const N: usize] VecDeque<A>, &mut [B; N], [B; N]: LengthAtMost32 }
26122600

26132601
#[stable(feature = "rust1", since = "1.0.0")]
26142602
impl<A: PartialOrd> PartialOrd for VecDeque<A> {

src/liballoc/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@
7878
#![feature(cfg_target_has_atomic)]
7979
#![feature(coerce_unsized)]
8080
#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))]
81+
#![feature(const_generic_impls_guard)]
82+
#![feature(const_generics)]
8183
#![feature(dispatch_from_dyn)]
8284
#![feature(core_intrinsics)]
8385
#![feature(dropck_eyepatch)]

src/liballoc/rc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ impl<T> Rc<[T]> {
815815
let slice = from_raw_parts_mut(self.elems, self.n_elems);
816816
ptr::drop_in_place(slice);
817817

818-
Global.dealloc(self.mem, self.layout.clone());
818+
Global.dealloc(self.mem, self.layout);
819819
}
820820
}
821821
}

src/liballoc/sync.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ impl<T> Arc<[T]> {
703703
let slice = from_raw_parts_mut(self.elems, self.n_elems);
704704
ptr::drop_in_place(slice);
705705

706-
Global.dealloc(self.mem.cast(), self.layout.clone());
706+
Global.dealloc(self.mem.cast(), self.layout);
707707
}
708708
}
709709
}

0 commit comments

Comments
 (0)