about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-07-18 00:01:59 +0200
committerMatthias Krüger <matthias.krueger@famsik.de>2021-07-25 12:26:02 +0200
commitaa74c75d849b63135c922c9c74324944af5bc487 (patch)
treeaa48745de58d76b17e27cb3ffaf60a3e3528a805
parentd709e6efefee52dc74b5f05195d6db3e9bddcd71 (diff)
downloadrust-aa74c75d849b63135c922c9c74324944af5bc487.tar.gz
rust-aa74c75d849b63135c922c9c74324944af5bc487.zip
clippy:: append_instead_of_extend
-rw-r--r--compiler/rustc_mir/src/monomorphize/partitioning/merging.rs2
-rw-r--r--compiler/rustc_mir/src/transform/inline.rs4
-rw-r--r--compiler/rustc_traits/src/dropck_outlives.rs4
3 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs b/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs
index 5107e697263..cbe36665790 100644
--- a/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs
+++ b/compiler/rustc_mir/src/monomorphize/partitioning/merging.rs
@@ -46,7 +46,7 @@ pub fn merge_codegen_units<'tcx>(
         // Record that `second_smallest` now contains all the stuff that was in
         // `smallest` before.
         let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap();
-        cgu_contents.get_mut(&second_smallest.name()).unwrap().extend(consumed_cgu_names.drain(..));
+        cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names);
 
         debug!(
             "CodegenUnit {} merged into CodegenUnit {}",
diff --git a/compiler/rustc_mir/src/transform/inline.rs b/compiler/rustc_mir/src/transform/inline.rs
index 7d765cec575..8e6654cb2da 100644
--- a/compiler/rustc_mir/src/transform/inline.rs
+++ b/compiler/rustc_mir/src/transform/inline.rs
@@ -614,8 +614,8 @@ impl Inliner<'tcx> {
                         .vars_and_temps_iter()
                         .map(|local| callee_body.local_decls[local].clone()),
                 );
-                caller_body.source_scopes.extend(callee_body.source_scopes.drain(..));
-                caller_body.var_debug_info.extend(callee_body.var_debug_info.drain(..));
+                caller_body.source_scopes.extend(&mut callee_body.source_scopes.drain(..));
+                caller_body.var_debug_info.append(&mut callee_body.var_debug_info);
                 caller_body.basic_blocks_mut().extend(callee_body.basic_blocks_mut().drain(..));
 
                 caller_body[callsite.block].terminator = Some(Terminator {
diff --git a/compiler/rustc_traits/src/dropck_outlives.rs b/compiler/rustc_traits/src/dropck_outlives.rs
index 4a41dfe0143..672e149b5fc 100644
--- a/compiler/rustc_traits/src/dropck_outlives.rs
+++ b/compiler/rustc_traits/src/dropck_outlives.rs
@@ -90,8 +90,8 @@ fn dropck_outlives<'tcx>(
 
                 // "outlives" represent types/regions that may be touched
                 // by a destructor.
-                result.kinds.extend(constraints.outlives.drain(..));
-                result.overflows.extend(constraints.overflows.drain(..));
+                result.kinds.append(&mut constraints.outlives);
+                result.overflows.append(&mut constraints.overflows);
 
                 // If we have even one overflow, we should stop trying to evaluate further --
                 // chances are, the subsequent overflows for this evaluation won't provide useful