Skip to content

Commit 8212de8

Browse files
committed
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`.
2 parents 7bd62a8 + ba9d143 commit 8212de8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_passes/src/liveness.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ impl<'tcx> Liveness<'_, 'tcx> {
14761476
for p in body.params {
14771477
self.check_unused_vars_in_pat(&p.pat, Some(entry_ln), |spans, hir_id, ln, var| {
14781478
if !self.live_on_entry(ln, var) {
1479-
self.report_unsed_assign(hir_id, spans, var, |name| {
1479+
self.report_unused_assign(hir_id, spans, var, |name| {
14801480
format!("value passed to `{}` is never read", name)
14811481
});
14821482
}
@@ -1615,13 +1615,13 @@ impl<'tcx> Liveness<'_, 'tcx> {
16151615

16161616
fn warn_about_dead_assign(&self, spans: Vec<Span>, hir_id: HirId, ln: LiveNode, var: Variable) {
16171617
if !self.live_on_exit(ln, var) {
1618-
self.report_unsed_assign(hir_id, spans, var, |name| {
1618+
self.report_unused_assign(hir_id, spans, var, |name| {
16191619
format!("value assigned to `{}` is never read", name)
16201620
});
16211621
}
16221622
}
16231623

1624-
fn report_unsed_assign(
1624+
fn report_unused_assign(
16251625
&self,
16261626
hir_id: HirId,
16271627
spans: Vec<Span>,

0 commit comments

Comments
 (0)