about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-26 11:18:25 +0000
committerbors <bors@rust-lang.org>2021-04-26 11:18:25 +0000
commit8212de8eb18a8cc4ab74074f244c386d5e99b281 (patch)
tree7f1b8fb53e2f5be2f045478e90d9546df1dc0b83 /compiler/rustc_passes/src
parent7bd62a8f5a4d6d740677aea03c37771258529922 (diff)
parentba9d1431185a97e6dfcb17df6a97abde68996e4c (diff)
downloadrust-8212de8eb18a8cc4ab74074f244c386d5e99b281.tar.gz
rust-8212de8eb18a8cc4ab74074f244c386d5e99b281.zip
Auto merge of #84546 - CohenArthur:fix-liveness-typo, r=jyn514
Fix typo  in report_unsed_assign

The function was called `report_unsed_assign`, which I assume is a typo, considering the rest of the file.
This replaces `report_unsed_assign` with `report_unused_assign`.
Diffstat (limited to 'compiler/rustc_passes/src')
-rw-r--r--compiler/rustc_passes/src/liveness.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs
index e22a108aaf0..fa930471c21 100644
--- a/compiler/rustc_passes/src/liveness.rs
+++ b/compiler/rustc_passes/src/liveness.rs
@@ -1476,7 +1476,7 @@ impl<'tcx> Liveness<'_, 'tcx> {
         for p in body.params {
             self.check_unused_vars_in_pat(&p.pat, Some(entry_ln), |spans, hir_id, ln, var| {
                 if !self.live_on_entry(ln, var) {
-                    self.report_unsed_assign(hir_id, spans, var, |name| {
+                    self.report_unused_assign(hir_id, spans, var, |name| {
                         format!("value passed to `{}` is never read", name)
                     });
                 }
@@ -1615,13 +1615,13 @@ impl<'tcx> Liveness<'_, 'tcx> {
 
     fn warn_about_dead_assign(&self, spans: Vec<Span>, hir_id: HirId, ln: LiveNode, var: Variable) {
         if !self.live_on_exit(ln, var) {
-            self.report_unsed_assign(hir_id, spans, var, |name| {
+            self.report_unused_assign(hir_id, spans, var, |name| {
                 format!("value assigned to `{}` is never read", name)
             });
         }
     }
 
-    fn report_unsed_assign(
+    fn report_unused_assign(
         &self,
         hir_id: HirId,
         spans: Vec<Span>,