about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBryysen <Brukkenbrisen@gmail.com>2022-08-07 23:50:12 +0200
committerBryysen <Brukkenbrisen@gmail.com>2022-08-07 23:50:12 +0200
commitbfd7535130692af426f1230777f313cf7610f45e (patch)
treec5046270658ed29876b75660933234cb4a59b990
parent399796d2b351b6ec3d58c47db610926f73ad779e (diff)
downloadrust-bfd7535130692af426f1230777f313cf7610f45e.tar.gz
rust-bfd7535130692af426f1230777f313cf7610f45e.zip
Fix wording on comment
-rw-r--r--compiler/rustc_typeck/src/check/check.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_typeck/src/check/check.rs b/compiler/rustc_typeck/src/check/check.rs
index e2527b78d78..1943d3de3ad 100644
--- a/compiler/rustc_typeck/src/check/check.rs
+++ b/compiler/rustc_typeck/src/check/check.rs
@@ -1526,7 +1526,7 @@ fn detect_discriminant_duplicate<'tcx>(
             }
             None => {
                 // At this point we know this discriminant is a duplicate, and was not explicitly
-                // assigned by the user. Here we iterate backwards to fetch the hir for the last
+                // assigned by the user. Here we iterate backwards to fetch the HIR for the last
                 // explictly assigned discriminant, and letting the user know that this was the
                 // increment startpoint, and how many steps from there leading to the duplicate
                 if let Some((n, hir::Variant { span, ident, .. })) =
@@ -1549,12 +1549,12 @@ fn detect_discriminant_duplicate<'tcx>(
         err.span_label(span, format!("{display_discr} assigned here"));
     };
 
-    // Here we are looping through the discriminant vec, comparing each discriminant to oneanother.
-    // When a duplicate is detected, we instatiate an error and add a spanned note pointing to both
-    // initial and duplicate value. The duplicate discriminant is then discarded from the vec by swapping
-    // it with the last element and decrementing the vec.len by 1 (which is why we have to evaluate
-    // `discrs.len()` anew every iteration, and why this could be tricky to do in a functional style as
-    // we are mutating `discrs` on the fly).
+    // Here we are loop through the discriminants, comparing each discriminant to another.
+    // When a duplicate is detected, we instatiate an error and point to both
+    // initial and duplicate value. The duplicate discriminant is then discarded by swapping
+    // it with the last element and decrementing the `vec.len` (which is why we have to evaluate
+    // `discrs.len()` anew every iteration, and why this could be tricky to do in a functional
+    // style as we are mutating `discrs` on the fly).
     let mut i = 0;
     while i < discrs.len() {
         let hir_var_i_idx = discrs[i].0.index();