about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorRoxane <roxane.fruytier@hotmail.com>2021-07-09 10:18:55 -0400
committerRoxane <roxane.fruytier@hotmail.com>2021-07-09 10:18:55 -0400
commit8cbeaf738267c8ddb5ab205dae4404e2f25eeeeb (patch)
treebd3481fecdebf1103e56ab3afa5f051b74a5d23c /compiler
parentca443729575da9c81e47da80adcbf1b14fa1e09b (diff)
downloadrust-8cbeaf738267c8ddb5ab205dae4404e2f25eeeeb.tar.gz
rust-8cbeaf738267c8ddb5ab205dae4404e2f25eeeeb.zip
Address comments
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_typeck/src/check/upvar.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_typeck/src/check/upvar.rs b/compiler/rustc_typeck/src/check/upvar.rs
index 2b82b4dff2e..b6d1468b7a6 100644
--- a/compiler/rustc_typeck/src/check/upvar.rs
+++ b/compiler/rustc_typeck/src/check/upvar.rs
@@ -619,7 +619,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         }
 
         if auto_trait_reasons.len() > 0 && drop_reason {
-            reasons = format!("{}, and ", reasons);
+            reasons = format!("{} and ", reasons);
         }
 
         if drop_reason {
@@ -886,12 +886,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
             };
 
             // Combine all the captures responsible for needing migrations into one HashSet
-            let mut capture_disagnostic = drop_reorder_diagnostic.clone();
+            let mut capture_diagnostic = drop_reorder_diagnostic.clone();
             for key in auto_trait_diagnostic.keys() {
-                capture_disagnostic.insert(key.clone());
+                capture_diagnostic.insert(key.clone());
             }
 
-            for captured_info in capture_disagnostic.iter() {
+            for captured_info in capture_diagnostic.iter() {
                 // Get the auto trait reasons of why migration is needed because of that capture, if there are any
                 let capture_trait_reasons =
                     if let Some(reasons) = auto_trait_diagnostic.get(captured_info) {
@@ -917,7 +917,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 ));
             }
 
-            if capture_disagnostic.len() > 0 {
+            if capture_diagnostic.len() > 0 {
                 need_migrations.push((var_hir_id, responsible_captured_hir_ids));
             }
         }