Skip to content

Commit d87625b

Browse files
committed
Auto merge of #56051 - pietroalbini:rollup, r=pietroalbini
Rollup of 25 pull requests Successful merges: - #55562 (Add powerpc- and powerpc64-unknown-linux-musl targets) - #55564 (test/linkage-visibility: Ignore on musl targets) - #55827 (A few tweaks to iterations/collecting) - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI) - #55857 (remove unused dependency) - #55862 (in which the E0618 "expected function" diagnostic gets a makeover) - #55867 (do not panic just because cargo failed) - #55894 (miri enum discriminant handling: Fix treatment of pointers, better error when it is undef) - #55916 (Make miri value visitor usfeful for mutation) - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code) - #55923 (reword #[test] attribute error on fn items) - #55935 (appveyor: Use VS2017 for all our images) - #55949 (ty: return impl Iterator from Predicate::walk_tys) - #55952 (Update to Clang 7 on CI.) - #55953 (#53488 Refactoring UpvarId) - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors) - #55963 (Stress test for MPSC) - #55968 (Clean up some non-mod-rs stuff.) - #55970 (Miri backtrace improvements) - #56007 (CTFE: dynamically make sure we do not call non-const-fn) - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.) - #56012 (avoid shared ref in UnsafeCell::get) - #56016 (Add VecDeque::resize_with) - #56027 (docs: Add missing backtick in object_safety.rs docs) - #56043 (remove "approx env bounds" if we already know from trait) Failed merges: r? @ghost
2 parents 7e82eda + c11f8b3 commit d87625b

File tree

125 files changed

+1254
-592
lines changed

Some content is hidden

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

125 files changed

+1254
-592
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ install:
227227
chmod +x /usr/local/bin/sccache &&
228228
travis_retry curl -fo /usr/local/bin/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin &&
229229
chmod +x /usr/local/bin/stamp &&
230-
travis_retry curl -f http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
231-
export CC=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang &&
232-
export CXX=`pwd`/clang+llvm-6.0.0-x86_64-apple-darwin/bin/clang++ &&
230+
travis_retry curl -f http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz | tar xJf - &&
231+
export CC=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang &&
232+
export CXX=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++ &&
233233
export AR=ar
234234
;;
235235
esac

appveyor.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
environment:
2-
SCCACHE_DIGEST: f808afabb4a4eb1d7112bcb3fa6be03b61e93412890c88e177c667eb37f46353d7ec294e559b16f9f4b5e894f2185fe7670a0df15fd064889ecbd80f0c34166c
2+
# This is required for at least an AArch64 compiler in one image, and is
3+
# otherwise recommended by AppVeyor currently for seeing if it has any
4+
# affect on our job times.
5+
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 Preview
36

47
# By default schannel checks revocation of certificates unlike some other SSL
58
# backends, but we've historically had problems on CI where a revocation
@@ -88,7 +91,6 @@ environment:
8891
DIST_REQUIRE_ALL_TOOLS: 1
8992
DEPLOY: 1
9093
CI_JOB_NAME: dist-x86_64-msvc
91-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 Preview
9294
- RUST_CONFIGURE_ARGS: >
9395
--build=i686-pc-windows-msvc
9496
--target=i586-pc-windows-msvc

src/Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,6 @@ dependencies = [
21912191
"graphviz 0.0.0",
21922192
"log 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
21932193
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
2194-
"parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
21952194
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
21962195
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
21972196
"rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",

src/bootstrap/compile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::fs::{self, File};
2222
use std::io::BufReader;
2323
use std::io::prelude::*;
2424
use std::path::{Path, PathBuf};
25-
use std::process::{Command, Stdio};
25+
use std::process::{Command, Stdio, exit};
2626
use std::str;
2727

2828
use build_helper::{output, mtime, up_to_date};
@@ -1098,7 +1098,7 @@ pub fn run_cargo(builder: &Builder,
10981098
});
10991099

11001100
if !ok {
1101-
panic!("cargo must succeed");
1101+
exit(1);
11021102
}
11031103

11041104
// Ok now we need to actually find all the files listed in `toplevel`. We've

src/ci/docker/dist-i686-linux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN ./build-gcc.sh
6767
COPY dist-x86_64-linux/build-python.sh /tmp/
6868
RUN ./build-python.sh
6969

70-
# Now build LLVM+Clang 6, afterwards configuring further compilations to use the
70+
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
7171
# clang/clang++ compilers.
7272
COPY dist-x86_64-linux/build-clang.sh /tmp/
7373
RUN ./build-clang.sh

src/ci/docker/dist-x86_64-linux/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN ./build-gcc.sh
6767
COPY dist-x86_64-linux/build-python.sh /tmp/
6868
RUN ./build-python.sh
6969

70-
# Now build LLVM+Clang 6, afterwards configuring further compilations to use the
70+
# Now build LLVM+Clang 7, afterwards configuring further compilations to use the
7171
# clang/clang++ compilers.
7272
COPY dist-x86_64-linux/build-clang.sh /tmp/
7373
RUN ./build-clang.sh

src/ci/docker/dist-x86_64-linux/build-clang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ set -ex
1313

1414
source shared.sh
1515

16-
LLVM=6.0.0
16+
LLVM=7.0.0
1717

1818
mkdir clang
1919
cd clang

src/ci/docker/scripts/musl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ hide_output make clean
5151

5252
cd ..
5353

54-
LLVM=60
54+
LLVM=70
5555

5656
# may have been downloaded in a previous run
5757
if [ ! -d libunwind-release_$LLVM ]; then

src/liballoc/collections/vec_deque.rs

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use core::cmp::Ordering;
2121
use core::fmt;
22-
use core::iter::{repeat, FromIterator, FusedIterator};
22+
use core::iter::{repeat, repeat_with, FromIterator, FusedIterator};
2323
use core::mem;
2424
use core::ops::Bound::{Excluded, Included, Unbounded};
2525
use core::ops::{Index, IndexMut, RangeBounds};
@@ -1920,6 +1920,44 @@ impl<T: Clone> VecDeque<T> {
19201920
self.truncate(new_len);
19211921
}
19221922
}
1923+
1924+
/// Modifies the `VecDeque` in-place so that `len()` is equal to `new_len`,
1925+
/// either by removing excess elements from the back or by appending
1926+
/// elements generated by calling `generator` to the back.
1927+
///
1928+
/// # Examples
1929+
///
1930+
/// ```
1931+
/// #![feature(vec_resize_with)]
1932+
///
1933+
/// use std::collections::VecDeque;
1934+
///
1935+
/// let mut buf = VecDeque::new();
1936+
/// buf.push_back(5);
1937+
/// buf.push_back(10);
1938+
/// buf.push_back(15);
1939+
/// assert_eq!(buf, [5, 10, 15]);
1940+
///
1941+
/// buf.resize_with(5, Default::default);
1942+
/// assert_eq!(buf, [5, 10, 15, 0, 0]);
1943+
///
1944+
/// buf.resize_with(2, || unreachable!());
1945+
/// assert_eq!(buf, [5, 10]);
1946+
///
1947+
/// let mut state = 100;
1948+
/// buf.resize_with(5, || { state += 1; state });
1949+
/// assert_eq!(buf, [5, 10, 101, 102, 103]);
1950+
/// ```
1951+
#[unstable(feature = "vec_resize_with", issue = "41758")]
1952+
pub fn resize_with(&mut self, new_len: usize, generator: impl FnMut()->T) {
1953+
let len = self.len();
1954+
1955+
if new_len > len {
1956+
self.extend(repeat_with(generator).take(new_len - len))
1957+
} else {
1958+
self.truncate(new_len);
1959+
}
1960+
}
19231961
}
19241962

19251963
/// Returns the index in the underlying buffer for a given logical element index.

src/libcore/cell.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,9 @@ impl<T: ?Sized> UnsafeCell<T> {
15091509
#[inline]
15101510
#[stable(feature = "rust1", since = "1.0.0")]
15111511
pub const fn get(&self) -> *mut T {
1512-
&self.value as *const T as *mut T
1512+
// We can just cast the pointer from `UnsafeCell<T>` to `T` because of
1513+
// #[repr(transparent)]
1514+
self as *const UnsafeCell<T> as *const T as *mut T
15131515
}
15141516
}
15151517

0 commit comments

Comments
 (0)