diff options
| author | bors <bors@rust-lang.org> | 2019-07-03 23:39:36 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-03 23:39:36 +0000 |
| commit | b43eb4235ac43c822d903ad26ed806f34cc1a14a (patch) | |
| tree | 124c3531ddc1815ad1586b3c78373f9e9117ce3c /src/libstd | |
| parent | 088b987307b91612ab164026e1dcdd0129fdb62b (diff) | |
| parent | 6363a58e9af1b00669ebf1e343a67e3d1815f463 (diff) | |
| download | rust-b43eb4235ac43c822d903ad26ed806f34cc1a14a.tar.gz rust-b43eb4235ac43c822d903ad26ed806f34cc1a14a.zip | |
Auto merge of #62355 - Centril:rollup-xnxtcgm, r=Centril
Rollup of 16 pull requests
Successful merges:
- #62039 (Remove needless lifetimes (rustc))
- #62173 (rename InterpretCx -> InterpCx)
- #62240 (wfcheck: resolve the type-vars in `AdtField` types)
- #62249 (Use mem::take instead of mem::replace with default)
- #62252 (Update mem::replace example to not be identical to mem::take)
- #62258 (syntax: Unsupport `foo! bar { ... }` macros in the parser)
- #62268 (Clean up inherent_impls)
- #62287 (Use link attributes on extern "C" blocks with llvm-libuwind)
- #62295 (miri realloc: do not require giving old size+align)
- #62297 (refactor check_for_substitution)
- #62316 (When possible without changing semantics, implement Iterator::last in terms of DoubleEndedIterator::next_back for types in liballoc and libcore.)
- #62317 (Migrate `compile-pass` annotations to `build-pass`)
- #62337 (Fix bucket in CPU usage script)
- #62344 (simplify Option::get_or_insert)
- #62346 (enable a few more tests in Miri and update the comment for others)
- #62351 (remove bogus example from drop_in_place)
Failed merges:
r? @ghost
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/lib.rs | 1 | ||||
| -rw-r--r-- | src/libstd/panicking.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/sync.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/pipe.rs | 2 |
4 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 60e06139eba..fb9a228880e 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -272,6 +272,7 @@ #![feature(libc)] #![feature(link_args)] #![feature(linkage)] +#![feature(mem_take)] #![feature(needs_panic_runtime)] #![feature(never_type)] #![feature(nll)] diff --git a/src/libstd/panicking.rs b/src/libstd/panicking.rs index 797d85e941d..952fd9ebfdf 100644 --- a/src/libstd/panicking.rs +++ b/src/libstd/panicking.rs @@ -364,7 +364,7 @@ fn continue_panic_fmt(info: &PanicInfo<'_>) -> ! { unsafe impl<'a> BoxMeUp for PanicPayload<'a> { fn box_me_up(&mut self) -> *mut (dyn Any + Send) { - let contents = mem::replace(self.fill(), String::new()); + let contents = mem::take(self.fill()); Box::into_raw(Box::new(contents)) } diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 3c4f8e077c9..f8fcd3ff5a5 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -383,7 +383,7 @@ impl<T> Packet<T> { // needs to be careful to destroy the data *outside* of the lock to // prevent deadlock. let _data = if guard.cap != 0 { - mem::replace(&mut guard.buf.buf, Vec::new()) + mem::take(&mut guard.buf.buf) } else { Vec::new() }; diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index 493ee8a9a2d..c77f30dfc71 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -342,7 +342,7 @@ impl<'a> Drop for AsyncPipe<'a> { // If anything here fails, there's not really much we can do, so we leak // the buffer/OVERLAPPED pointers to ensure we're at least memory safe. if self.pipe.cancel_io().is_err() || self.result().is_err() { - let buf = mem::replace(self.dst, Vec::new()); + let buf = mem::take(self.dst); let overlapped = Box::new(unsafe { mem::zeroed() }); let overlapped = mem::replace(&mut self.overlapped, overlapped); mem::forget((buf, overlapped)); |
