Skip to content

Commit 254f879

Browse files
committed
Auto merge of rust-lang#52352 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests Successful merges: - rust-lang#51962 (Provide llvm-strip in llvm-tools component) - rust-lang#52003 (Implement `Option::replace` in the core library) - rust-lang#52156 (Update std::ascii::ASCIIExt deprecation notes) - rust-lang#52280 (llvm-tools-preview: fix build-manifest) - rust-lang#52290 (Deny bare trait objects in src/librustc_save_analysis) - rust-lang#52293 (Deny bare trait objects in librustc_typeck) - rust-lang#52299 (Deny bare trait objects in src/libserialize) - rust-lang#52300 (Deny bare trait objects in librustc_target and libtest) - rust-lang#52302 (Deny bare trait objects in the rest of rust) - rust-lang#52310 (Backport 1.27.1 release notes to master) - rust-lang#52315 (Resolve FIXME(rust-lang#27942)) - rust-lang#52316 (task: remove wrong comments about non-existent LocalWake trait) - rust-lang#52322 (Update llvm-rebuild-trigger in light of LLVM 7 upgrade) - rust-lang#52330 (Don't silently ignore invalid data in target spec) - rust-lang#52333 (CI: Enable core dump on Linux, and print their stack trace on segfault. ) - rust-lang#52346 (Fix typo in improper_ctypes suggestion) - rust-lang#52350 (Bump bootstrap compiler to 1.28.0-beta.10) Failed merges: r? @ghost
2 parents fe29a4c + ea9b8dd commit 254f879

File tree

58 files changed

+239
-88
lines changed

Some content is hidden

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

58 files changed

+239
-88
lines changed

.travis.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ sudo: required
33
dist: trusty
44
services:
55
- docker
6+
addons:
7+
apt:
8+
packages:
9+
- gdb
610

711
git:
812
depth: 2
@@ -249,6 +253,8 @@ before_script:
249253
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/run.sh";
250254
else
251255
export RUN_SCRIPT="$RUN_SCRIPT && src/ci/docker/run.sh $IMAGE";
256+
# Enable core dump on Linux.
257+
sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern';
252258
fi
253259
254260
# Log time information from this machine and an external machine for insight into possible
@@ -274,6 +280,8 @@ after_failure:
274280
275281
# Random attempt at debugging currently. Just poking around in here to see if
276282
# anything shows up.
283+
284+
# Dump backtrace for macOS
277285
- ls -lat $HOME/Library/Logs/DiagnosticReports/
278286
- find $HOME/Library/Logs/DiagnosticReports
279287
-type f
@@ -284,8 +292,24 @@ after_failure:
284292
-exec head -750 {} \;
285293
-exec echo travis_fold":"end:crashlog \; || true
286294

295+
# Dump backtrace for Linux
296+
- ln -s . checkout &&
297+
for CORE in obj/cores/core.*; do
298+
EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|');
299+
if [ -f "$EXE" ]; then
300+
printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE";
301+
gdb -q -c "$CORE" "$EXE"
302+
-iex 'set auto-load off'
303+
-iex 'dir src/'
304+
-iex 'set sysroot .'
305+
-ex bt
306+
-ex q;
307+
echo travis_fold":"end:crashlog;
308+
fi;
309+
done || true
310+
287311
# see #50887
288-
- head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
312+
- cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
289313

290314
# attempt to debug anything killed by the oom killer on linux, just to see if
291315
# it happened

RELEASES.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,29 @@ Compatibility Notes
140140
[`{Any + Send + Sync}::downcast_ref`]: https://doc.rust-lang.org/std/any/trait.Any.html#method.downcast_ref-2
141141
[`{Any + Send + Sync}::is`]: https://doc.rust-lang.org/std/any/trait.Any.html#method.is-2
142142

143+
Version 1.27.1 (2018-07-10)
144+
===========================
145+
146+
Security Notes
147+
--------------
148+
149+
- rustdoc would execute plugins in the /tmp/rustdoc/plugins directory
150+
when running, which enabled executing code as some other user on a
151+
given machine. This release fixes that vulnerability; you can read
152+
more about this on the [blog][rustdoc-sec]. The associated CVE is [CVE-2018-1000622].
153+
154+
Thank you to Red Hat for responsibily disclosing this vulnerability to us.
155+
156+
Compatibility Notes
157+
-------------------
158+
159+
- The borrow checker was fixed to avoid an additional potential unsoundness when using
160+
match ergonomics: [#51415][51415], [#49534][49534].
161+
162+
[51415]: https://github.com/rust-lang/rust/issues/51415
163+
[49534]: https://github.com/rust-lang/rust/issues/49534
164+
[rustdoc-sec]: https://blog.rust-lang.org/2018/07/06/security-advisory-for-rustdoc.html
165+
[CVE-2018-1000622]: https://cve.mitre.org/cgi-bin/cvename.cgi?name=%20CVE-2018-1000622
143166

144167
Version 1.27.0 (2018-06-21)
145168
==========================

src/bootstrap/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ const LLVM_TOOLS: &[&str] = &[
206206
"llvm-objcopy", // used to transform ELFs into binary format which flashing tools consume
207207
"llvm-objdump", // used to disassemble programs
208208
"llvm-profdata", // used to inspect and merge files generated by profiles
209-
"llvm-size", // prints the size of the linker sections of a program
209+
"llvm-size", // used to prints the size of the linker sections of a program
210+
"llvm-strip", // used to discard symbols from binary files to reduce their size
210211
];
211212

212213
/// A structure representing a Rust compiler.

src/build_helper/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![deny(bare_trait_objects)]
12+
1113
use std::fs::File;
1214
use std::path::{Path, PathBuf};
1315
use std::process::{Command, Stdio};

src/ci/docker/run.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ objdir=$root_dir/obj
9999

100100
mkdir -p $HOME/.cargo
101101
mkdir -p $objdir/tmp
102+
mkdir $objdir/cores
102103

103104
args=
104105
if [ "$SCCACHE_BUCKET" != "" ]; then

src/ci/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ if [ "$NO_CHANGE_USER" = "" ]; then
2424
fi
2525
fi
2626

27+
# only enable core dump on Linux
28+
if [ -f /proc/sys/kernel/core_pattern ]; then
29+
ulimit -c unlimited
30+
fi
31+
2732
ci_dir=`cd $(dirname $0) && pwd`
2833
source "$ci_dir/shared.sh"
2934

src/liballoc_jemalloc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![no_std]
1212
#![allow(unused_attributes)]
13+
#![deny(bare_trait_objects)]
1314
#![unstable(feature = "alloc_jemalloc",
1415
reason = "implementation detail of std, does not provide any public API",
1516
issue = "0")]

src/liballoc_system/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![no_std]
1212
#![allow(unused_attributes)]
13+
#![deny(bare_trait_objects)]
1314
#![unstable(feature = "alloc_system",
1415
reason = "this library is unlikely to be stabilized in its current \
1516
form or name",

src/libarena/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#![cfg_attr(test, feature(test))]
3131

3232
#![allow(deprecated)]
33+
#![deny(bare_trait_objects)]
3334

3435
extern crate alloc;
3536
extern crate rustc_data_structures;

src/libcore/option.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,33 @@ impl<T> Option<T> {
845845
pub fn take(&mut self) -> Option<T> {
846846
mem::replace(self, None)
847847
}
848+
849+
/// Replaces the actual value in the option by the value given in parameter,
850+
/// returning the old value if present,
851+
/// leaving a [`Some`] in its place without deinitializing either one.
852+
///
853+
/// [`Some`]: #variant.Some
854+
///
855+
/// # Examples
856+
///
857+
/// ```
858+
/// #![feature(option_replace)]
859+
///
860+
/// let mut x = Some(2);
861+
/// let old = x.replace(5);
862+
/// assert_eq!(x, Some(5));
863+
/// assert_eq!(old, Some(2));
864+
///
865+
/// let mut x = None;
866+
/// let old = x.replace(3);
867+
/// assert_eq!(x, Some(3));
868+
/// assert_eq!(old, None);
869+
/// ```
870+
#[inline]
871+
#[unstable(feature = "option_replace", issue = "51998")]
872+
pub fn replace(&mut self, value: T) -> Option<T> {
873+
mem::replace(self, Some(value))
874+
}
848875
}
849876

850877
impl<'a, T: Clone> Option<&'a T> {

0 commit comments

Comments
 (0)