about summary refs log tree commit diff
diff options
context:
space:
mode:
authorcuishuang <imcusg@gmail.com>2023-12-28 12:23:14 +0800
committercuishuang <imcusg@gmail.com>2023-12-28 12:23:14 +0800
commit1adf0c16ff6119f34bbfd8ae073cf8ab202439d5 (patch)
tree6022c76fba76f4b94427ca83d6b96a2daa926760
parent8e346422620b4884e42f6e52482be74c265b9157 (diff)
downloadrust-1adf0c16ff6119f34bbfd8ae073cf8ab202439d5.tar.gz
rust-1adf0c16ff6119f34bbfd8ae073cf8ab202439d5.zip
Fix some comments
Signed-off-by: cuishuang <imcusg@gmail.com>
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs2
-rw-r--r--compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs2
-rw-r--r--compiler/rustc_hir_typeck/src/pat.rs2
-rw-r--r--compiler/rustc_mir_transform/src/large_enums.rs2
4 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
index ca65488375c..3ec07572d1d 100644
--- a/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
@@ -482,7 +482,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
         span: Span,
         use_spans: UseSpans<'tcx>,
     ) -> DiagnosticBuilder<'cx> {
-        // We need all statements in the body where the binding was assigned to to later find all
+        // We need all statements in the body where the binding was assigned to later find all
         // the branching code paths where the binding *wasn't* assigned to.
         let inits = &self.move_data.init_path_map[mpi];
         let move_path = &self.move_data.move_paths[mpi];
diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs
index 71fbd983b6a..fd1571426c8 100644
--- a/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs
+++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs
@@ -32,7 +32,7 @@ pub(super) fn check_refining_return_position_impl_trait_in_trait<'tcx>(
         return;
     }
 
-    // If a type in the trait ref is private, then there's also no reason to to do this check.
+    // If a type in the trait ref is private, then there's also no reason to do this check.
     let impl_def_id = impl_m.container_id(tcx);
     for arg in impl_trait_ref.args {
         if let Some(ty) = arg.as_type()
diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs
index 6deeb8bee5d..02a35110716 100644
--- a/compiler/rustc_hir_typeck/src/pat.rs
+++ b/compiler/rustc_hir_typeck/src/pat.rs
@@ -2080,7 +2080,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
     /// ```
     ///
     /// If we're in an irrefutable pattern we prefer the array impl candidate given that
-    /// the slice impl candidate would be be rejected anyway (if no ambiguity existed).
+    /// the slice impl candidate would be rejected anyway (if no ambiguity existed).
     fn pat_is_irrefutable(&self, decl_origin: Option<DeclOrigin<'_>>) -> bool {
         match decl_origin {
             Some(DeclOrigin::LocalDecl { els: None }) => true,
diff --git a/compiler/rustc_mir_transform/src/large_enums.rs b/compiler/rustc_mir_transform/src/large_enums.rs
index 1d788a55ff8..8be96b6ba8f 100644
--- a/compiler/rustc_mir_transform/src/large_enums.rs
+++ b/compiler/rustc_mir_transform/src/large_enums.rs
@@ -9,7 +9,7 @@ use rustc_target::abi::{HasDataLayout, Size, TagEncoding, Variants};
 /// A pass that seeks to optimize unnecessary moves of large enum types, if there is a large
 /// enough discrepancy between them.
 ///
-/// i.e. If there is are two variants:
+/// i.e. If there are two variants:
 /// ```
 /// enum Example {
 ///   Small,