]> git.lizzy.rs Git - rust.git/commitdiff
Revert change in compiletest
authorChris Gregory <czipperz@gmail.com>
Sun, 30 Jun 2019 21:51:14 +0000 (14:51 -0700)
committerChris Gregory <czipperz@gmail.com>
Tue, 2 Jul 2019 03:21:53 +0000 (20:21 -0700)
src/tools/compiletest/src/main.rs
src/tools/compiletest/src/runtest.rs

index 517f2a362f5541a544dc095a80d0c15571e65157..597fdf2d95e3097b7fcd5214703c53fba5674473 100644 (file)
@@ -1,5 +1,4 @@
 #![crate_name = "compiletest"]
-#![feature(mem_take)]
 #![feature(test)]
 #![feature(vec_remove_item)]
 #![deny(warnings, rust_2018_idioms)]
index 6053b538ff3225fcb3b50b054c95d4954c9cc93d..35caf82dd71287fcf65e17d335cdd2329dc71150 100644 (file)
@@ -3608,7 +3608,7 @@ fn nocomment_mir_line(line: &str) -> &str {
 
 fn read2_abbreviated(mut child: Child) -> io::Result<Output> {
     use crate::read2::read2;
-    use std::mem::take;
+    use std::mem::replace;
 
     const HEAD_LEN: usize = 160 * 1024;
     const TAIL_LEN: usize = 256 * 1024;
@@ -3632,7 +3632,7 @@ fn extend(&mut self, data: &[u8]) {
                         return;
                     }
                     let tail = bytes.split_off(new_len - TAIL_LEN).into_boxed_slice();
-                    let head = take(bytes);
+                    let head = replace(bytes, Vec::new());
                     let skipped = new_len - HEAD_LEN - TAIL_LEN;
                     ProcOutput::Abbreviated {
                         head,