about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_apfloat/tests/ieee.rs8
-rw-r--r--compiler/rustc_apfloat/tests/ppc.rs20
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs2
-rw-r--r--compiler/rustc_codegen_cranelift/src/compiler_builtins.rs2
-rw-r--r--compiler/rustc_expand/src/parse/tests.rs2
-rw-r--r--compiler/rustc_infer/src/infer/region_constraints/mod.rs2
-rw-r--r--compiler/rustc_passes/src/stability.rs2
-rw-r--r--compiler/rustc_serialize/tests/json.rs2
-rw-r--r--compiler/rustc_session/src/config.rs4
-rw-r--r--compiler/rustc_target/src/abi/call/x86_64.rs2
-rw-r--r--compiler/rustc_target/src/abi/mod.rs4
-rw-r--r--compiler/rustc_typeck/src/check/callee.rs2
-rw-r--r--compiler/rustc_typeck/src/check/compare_method.rs2
-rw-r--r--compiler/rustc_typeck/src/check/fn_ctxt/checks.rs2
-rw-r--r--compiler/rustc_typeck/src/check/method/probe.rs2
-rw-r--r--compiler/rustc_typeck/src/check/place_op.rs2
-rw-r--r--src/librustdoc/passes/collect_intra_doc_links.rs8
17 files changed, 34 insertions, 34 deletions
diff --git a/compiler/rustc_apfloat/tests/ieee.rs b/compiler/rustc_apfloat/tests/ieee.rs
index 63d925cce9a..22641064315 100644
--- a/compiler/rustc_apfloat/tests/ieee.rs
+++ b/compiler/rustc_apfloat/tests/ieee.rs
@@ -1939,7 +1939,7 @@ fn add() {
         (m_smallest_normalized, m_smallest_normalized, "-0x1p-125", Status::OK, Category::Normal),
     ];
 
-    for &(x, y, e_result, e_status, e_category) in &special_cases[..] {
+    for (x, y, e_result, e_status, e_category) in special_cases {
         let status;
         let result = unpack!(status=, x + y);
         assert_eq!(status, e_status);
@@ -2262,7 +2262,7 @@ fn subtract() {
         (m_smallest_normalized, m_smallest_normalized, "0x0p+0", Status::OK, Category::Zero),
     ];
 
-    for &(x, y, e_result, e_status, e_category) in &special_cases[..] {
+    for (x, y, e_result, e_status, e_category) in special_cases {
         let status;
         let result = unpack!(status=, x - y);
         assert_eq!(status, e_status);
@@ -2538,7 +2538,7 @@ fn multiply() {
         (m_smallest_normalized, m_smallest_normalized, "0x0p+0", underflow_status, Category::Zero),
     ];
 
-    for &(x, y, e_result, e_status, e_category) in &special_cases[..] {
+    for (x, y, e_result, e_status, e_category) in special_cases {
         let status;
         let result = unpack!(status=, x * y);
         assert_eq!(status, e_status);
@@ -2814,7 +2814,7 @@ fn divide() {
         (m_smallest_normalized, m_smallest_normalized, "0x1p+0", Status::OK, Category::Normal),
     ];
 
-    for &(x, y, e_result, e_status, e_category) in &special_cases[..] {
+    for (x, y, e_result, e_status, e_category) in special_cases {
         let status;
         let result = unpack!(status=, x / y);
         assert_eq!(status, e_status);
diff --git a/compiler/rustc_apfloat/tests/ppc.rs b/compiler/rustc_apfloat/tests/ppc.rs
index 5a8de71cb34..c769d265437 100644
--- a/compiler/rustc_apfloat/tests/ppc.rs
+++ b/compiler/rustc_apfloat/tests/ppc.rs
@@ -64,7 +64,7 @@ fn ppc_double_double_add_special() {
         (0x7ff8000000000000, 0x3ff0000000000000, Category::NaN, Round::NearestTiesToEven),
     ];
 
-    for &(op1, op2, expected, round) in &data {
+    for (op1, op2, expected, round) in data {
         {
             let mut a1 = DoubleDouble::from_bits(op1);
             let a2 = DoubleDouble::from_bits(op2);
@@ -135,7 +135,7 @@ fn ppc_double_double_add() {
         ),
     ];
 
-    for &(op1, op2, expected, round) in &data {
+    for (op1, op2, expected, round) in data {
         {
             let mut a1 = DoubleDouble::from_bits(op1);
             let a2 = DoubleDouble::from_bits(op2);
@@ -172,7 +172,7 @@ fn ppc_double_double_subtract() {
         ),
     ];
 
-    for &(op1, op2, expected, round) in &data {
+    for (op1, op2, expected, round) in data {
         let mut a1 = DoubleDouble::from_bits(op1);
         let a2 = DoubleDouble::from_bits(op2);
         a1 = a1.sub_r(a2, round).value;
@@ -204,7 +204,7 @@ fn ppc_double_double_multiply_special() {
         (0, 0x3ff0000000000000, Category::Zero, Round::NearestTiesToEven),
     ];
 
-    for &(op1, op2, expected, round) in &data {
+    for (op1, op2, expected, round) in data {
         {
             let mut a1 = DoubleDouble::from_bits(op1);
             let a2 = DoubleDouble::from_bits(op2);
@@ -290,7 +290,7 @@ fn ppc_double_double_multiply() {
         ),
     ];
 
-    for &(op1, op2, expected, round) in &data {
+    for (op1, op2, expected, round) in data {
         {
             let mut a1 = DoubleDouble::from_bits(op1);
             let a2 = DoubleDouble::from_bits(op2);
@@ -322,7 +322,7 @@ fn ppc_double_double_divide() {
         ),
     ];
 
-    for &(op1, op2, expected, round) in &data {
+    for (op1, op2, expected, round) in data {
         let mut a1 = DoubleDouble::from_bits(op1);
         let a2 = DoubleDouble::from_bits(op2);
         a1 = a1.div_r(a2, round).value;
@@ -348,7 +348,7 @@ fn ppc_double_double_remainder() {
         ),
     ];
 
-    for &(op1, op2, expected) in &data {
+    for (op1, op2, expected) in data {
         let a1 = DoubleDouble::from_bits(op1);
         let a2 = DoubleDouble::from_bits(op2);
         let result = a1.ieee_rem(a2).value;
@@ -376,7 +376,7 @@ fn ppc_double_double_mod() {
         ),
     ];
 
-    for &(op1, op2, expected) in &data {
+    for (op1, op2, expected) in data {
         let a1 = DoubleDouble::from_bits(op1);
         let a2 = DoubleDouble::from_bits(op2);
         let r = (a1 % a2).value;
@@ -426,7 +426,7 @@ fn ppc_double_double_compare() {
         (0x7ff0000000000000, 0x7ff0000000000000, Some(Ordering::Equal)),
     ];
 
-    for &(op1, op2, expected) in &data {
+    for (op1, op2, expected) in data {
         let a1 = DoubleDouble::from_bits(op1);
         let a2 = DoubleDouble::from_bits(op2);
         assert_eq!(expected, a1.partial_cmp(&a2), "compare({:#x}, {:#x})", op1, op2,);
@@ -448,7 +448,7 @@ fn ppc_double_double_bitwise_eq() {
         (0x7ff0000000000000, 0x7ff0000000000000, true),
     ];
 
-    for &(op1, op2, expected) in &data {
+    for (op1, op2, expected) in data {
         let a1 = DoubleDouble::from_bits(op1);
         let a2 = DoubleDouble::from_bits(op2);
         assert_eq!(expected, a1.bitwise_eq(a2), "{:#x} = {:#x}", op1, op2);
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 0ff1efd8165..dbab7e15484 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -417,7 +417,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
             fn allocate_use_tree_hir_id_counters(&mut self, tree: &UseTree) {
                 match tree.kind {
                     UseTreeKind::Simple(_, id1, id2) => {
-                        for &id in &[id1, id2] {
+                        for id in [id1, id2] {
                             self.lctx.allocate_hir_id_counter(id);
                         }
                     }
diff --git a/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs b/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs
index 177f850afb3..100c3b43160 100644
--- a/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs
+++ b/compiler/rustc_codegen_cranelift/src/compiler_builtins.rs
@@ -7,7 +7,7 @@ macro builtin_functions($register:ident; $(fn $name:ident($($arg_name:ident: $ar
 
     #[cfg(feature = "jit")]
     pub(crate) fn $register(builder: &mut cranelift_jit::JITBuilder) {
-        for &(name, val) in &[$((stringify!($name), $name as *const u8)),*] {
+        for (name, val) in [$((stringify!($name), $name as *const u8)),*] {
             builder.symbol(name, val);
         }
     }
diff --git a/compiler/rustc_expand/src/parse/tests.rs b/compiler/rustc_expand/src/parse/tests.rs
index 56f25ffdb01..288efe22982 100644
--- a/compiler/rustc_expand/src/parse/tests.rs
+++ b/compiler/rustc_expand/src/parse/tests.rs
@@ -193,7 +193,7 @@ fn span_of_self_arg_pat_idents_are_correct() {
             "impl z { fn a (self: Foo, &myarg: i32) {} }",
         ];
 
-        for &src in &srcs {
+        for src in srcs {
             let spans = get_spans_of_pat_idents(src);
             let (lo, hi) = (spans[0].lo(), spans[0].hi());
             assert!(
diff --git a/compiler/rustc_infer/src/infer/region_constraints/mod.rs b/compiler/rustc_infer/src/infer/region_constraints/mod.rs
index 49359130162..7f4c33c5792 100644
--- a/compiler/rustc_infer/src/infer/region_constraints/mod.rs
+++ b/compiler/rustc_infer/src/infer/region_constraints/mod.rs
@@ -674,7 +674,7 @@ impl<'tcx> RegionConstraintCollector<'_, 'tcx> {
         self.combine_map(t).insert(vars, c);
         self.undo_log.push(AddCombination(t, vars));
         let new_r = tcx.mk_region(ReVar(c));
-        for &old_r in &[a, b] {
+        for old_r in [a, b] {
             match t {
                 Glb => self.make_subregion(origin.clone(), new_r, old_r),
                 Lub => self.make_subregion(origin.clone(), old_r, new_r),
diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs
index f41e0e03706..ca9b83876b4 100644
--- a/compiler/rustc_passes/src/stability.rs
+++ b/compiler/rustc_passes/src/stability.rs
@@ -938,7 +938,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
     if !remaining_lib_features.is_empty() {
         check_features(&mut remaining_lib_features, &local_defined_features);
 
-        for &cnum in &*tcx.crates() {
+        for &cnum in tcx.crates() {
             if remaining_lib_features.is_empty() {
                 break;
             }
diff --git a/compiler/rustc_serialize/tests/json.rs b/compiler/rustc_serialize/tests/json.rs
index e3a823127d9..a759fa1bf1a 100644
--- a/compiler/rustc_serialize/tests/json.rs
+++ b/compiler/rustc_serialize/tests/json.rs
@@ -437,7 +437,7 @@ fn test_decode_str() {
         ("\"\\uAB12\"", "\u{AB12}"),
     ];
 
-    for &(i, o) in &s {
+    for (i, o) in s {
         let v: string::String = json::decode(i).unwrap();
         assert_eq!(v, o);
     }
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 2b547f8be92..1ed336f6ed3 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -833,7 +833,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
     if sess.target.has_elf_tls {
         ret.insert((sym::target_thread_local, None));
     }
-    for &(i, align) in &[
+    for (i, align) in [
         (8, layout.i8_align.abi),
         (16, layout.i16_align.abi),
         (32, layout.i32_align.abi),
@@ -1169,7 +1169,7 @@ pub fn get_cmd_lint_options(
     let mut lint_opts_with_position = vec![];
     let mut describe_lints = false;
 
-    for &level in &[lint::Allow, lint::Warn, lint::Deny, lint::Forbid] {
+    for level in [lint::Allow, lint::Warn, lint::Deny, lint::Forbid] {
         for (passed_arg_pos, lint_name) in matches.opt_strs_pos(level.as_str()) {
             let arg_pos = if let lint::Forbid = level {
                 // HACK: forbid is always specified last, so it can't be overridden.
diff --git a/compiler/rustc_target/src/abi/call/x86_64.rs b/compiler/rustc_target/src/abi/call/x86_64.rs
index 5f154dc1bc9..a55658b7a3e 100644
--- a/compiler/rustc_target/src/abi/call/x86_64.rs
+++ b/compiler/rustc_target/src/abi/call/x86_64.rs
@@ -185,7 +185,7 @@ where
             if let Ok(cls) = cls_or_mem {
                 let mut needed_int = 0;
                 let mut needed_sse = 0;
-                for &c in &cls {
+                for c in cls {
                     match c {
                         Some(Class::Int) => needed_int += 1,
                         Some(Class::Sse) => needed_sse += 1,
diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs
index 8e71ded3d1d..e3a721fc736 100644
--- a/compiler/rustc_target/src/abi/mod.rs
+++ b/compiler/rustc_target/src/abi/mod.rs
@@ -590,7 +590,7 @@ impl Integer {
     pub fn for_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Option<Integer> {
         let dl = cx.data_layout();
 
-        for &candidate in &[I8, I16, I32, I64, I128] {
+        for candidate in [I8, I16, I32, I64, I128] {
             if wanted == candidate.align(dl).abi && wanted.bytes() == candidate.size().bytes() {
                 return Some(candidate);
             }
@@ -603,7 +603,7 @@ impl Integer {
         let dl = cx.data_layout();
 
         // FIXME(eddyb) maybe include I128 in the future, when it works everywhere.
-        for &candidate in &[I64, I32, I16] {
+        for candidate in [I64, I32, I16] {
             if wanted >= candidate.align(dl).abi && wanted.bytes() >= candidate.size().bytes() {
                 return candidate;
             }
diff --git a/compiler/rustc_typeck/src/check/callee.rs b/compiler/rustc_typeck/src/check/callee.rs
index cb8f336721a..ed62899c04e 100644
--- a/compiler/rustc_typeck/src/check/callee.rs
+++ b/compiler/rustc_typeck/src/check/callee.rs
@@ -205,7 +205,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         opt_arg_exprs: Option<&'tcx [hir::Expr<'tcx>]>,
     ) -> Option<(Option<Adjustment<'tcx>>, MethodCallee<'tcx>)> {
         // Try the options that are least restrictive on the caller first.
-        for &(opt_trait_def_id, method_name, borrow) in &[
+        for (opt_trait_def_id, method_name, borrow) in [
             (self.tcx.lang_items().fn_trait(), Ident::with_dummy_span(sym::call), true),
             (self.tcx.lang_items().fn_mut_trait(), Ident::with_dummy_span(sym::call_mut), true),
             (self.tcx.lang_items().fn_once_trait(), Ident::with_dummy_span(sym::call_once), false),
diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_typeck/src/check/compare_method.rs
index 60ca562f992..95a1bfbbb01 100644
--- a/compiler/rustc_typeck/src/check/compare_method.rs
+++ b/compiler/rustc_typeck/src/check/compare_method.rs
@@ -579,7 +579,7 @@ fn compare_number_of_generics<'tcx>(
     let item_kind = assoc_item_kind_str(impl_);
 
     let mut err_occurred = false;
-    for &(kind, trait_count, impl_count) in &matchings {
+    for (kind, trait_count, impl_count) in matchings {
         if impl_count != trait_count {
             err_occurred = true;
 
diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
index 49aea19c8d0..d6989b866c1 100644
--- a/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
+++ b/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
@@ -291,7 +291,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         // that are not closures, then we type-check the closures. This is so
         // that we have more information about the types of arguments when we
         // type-check the functions. This isn't really the right way to do this.
-        for &check_closures in &[false, true] {
+        for check_closures in [false, true] {
             debug!("check_closures={}", check_closures);
 
             // More awful hacks: before we check argument types, try to do
diff --git a/compiler/rustc_typeck/src/check/method/probe.rs b/compiler/rustc_typeck/src/check/method/probe.rs
index 440e0f4e1a2..9037ffe49a9 100644
--- a/compiler/rustc_typeck/src/check/method/probe.rs
+++ b/compiler/rustc_typeck/src/check/method/probe.rs
@@ -668,7 +668,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
                 self.assemble_inherent_impl_for_primitive(lang_def_id);
             }
             ty::Slice(_) => {
-                for &lang_def_id in &[
+                for lang_def_id in [
                     lang_items.slice_impl(),
                     lang_items.slice_u8_impl(),
                     lang_items.slice_alloc_impl(),
diff --git a/compiler/rustc_typeck/src/check/place_op.rs b/compiler/rustc_typeck/src/check/place_op.rs
index 652b82f1063..055072d3a1d 100644
--- a/compiler/rustc_typeck/src/check/place_op.rs
+++ b/compiler/rustc_typeck/src/check/place_op.rs
@@ -82,7 +82,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             expr, base_expr, adjusted_ty, index_ty
         );
 
-        for &unsize in &[false, true] {
+        for unsize in [false, true] {
             let mut self_ty = adjusted_ty;
             if unsize {
                 // We only unsize arrays here.
diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
index 247a020f2a2..9db83c903ab 100644
--- a/src/librustdoc/passes/collect_intra_doc_links.rs
+++ b/src/librustdoc/passes/collect_intra_doc_links.rs
@@ -1346,7 +1346,7 @@ impl LinkCollector<'_, '_> {
                             let other_ns = if expected_ns == ValueNS { TypeNS } else { ValueNS };
                             // FIXME: really it should be `resolution_failure` that does this, not `resolve_with_disambiguator`
                             // See https://github.com/rust-lang/rust/pull/76955#discussion_r493953382 for a good approach
-                            for &new_ns in &[other_ns, MacroNS] {
+                            for new_ns in [other_ns, MacroNS] {
                                 if let Some(res) =
                                     self.check_full_res(new_ns, path_str, base_node, extra_fragment)
                                 {
@@ -1444,7 +1444,7 @@ impl LinkCollector<'_, '_> {
                     Ok(res) => Some((res, extra_fragment.clone())),
                     Err(mut kind) => {
                         // `resolve_macro` only looks in the macro namespace. Try to give a better error if possible.
-                        for &ns in &[TypeNS, ValueNS] {
+                        for ns in [TypeNS, ValueNS] {
                             if let Some(res) =
                                 self.check_full_res(ns, path_str, base_node, extra_fragment)
                             {
@@ -1558,7 +1558,7 @@ impl Disambiguator {
                 ("()", DefKind::Fn),
                 ("!", DefKind::Macro(MacroKind::Bang)),
             ];
-            for &(suffix, kind) in &suffixes {
+            for (suffix, kind) in suffixes {
                 if let Some(link) = link.strip_suffix(suffix) {
                     // Avoid turning `!` or `()` into an empty string
                     if !link.is_empty() {
@@ -1798,7 +1798,7 @@ fn resolution_failure(
                             break;
                         };
                         name = start;
-                        for &ns in &[TypeNS, ValueNS, MacroNS] {
+                        for ns in [TypeNS, ValueNS, MacroNS] {
                             if let Some(res) =
                                 collector.check_full_res(ns, &start, module_id.into(), &None)
                             {