Skip to content

Commit 5151c08

Browse files
committed
Issue #2591: Fix "upvar" jargon in borrowck error messages
1 parent 7b98fdd commit 5151c08

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/rustc/middle/borrowck.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,15 @@ impl to_str_methods for borrowck_ctxt {
460460
cat_special(sk_method) { "method" }
461461
cat_special(sk_static_item) { "static item" }
462462
cat_special(sk_self) { "self reference" }
463-
cat_special(sk_heap_upvar) { "upvar" }
463+
cat_special(sk_heap_upvar) { "variable declared in an outer block" }
464464
cat_rvalue { "non-lvalue" }
465465
cat_local(_) { mut_str + " local variable" }
466466
cat_arg(_) { "argument" }
467467
cat_deref(_, _, pk) { #fmt["dereference of %s %s pointer",
468468
mut_str, self.pk_to_sigil(pk)] }
469-
cat_stack_upvar(_) { mut_str + " upvar" }
469+
cat_stack_upvar(_) {
470+
mut_str + " variable declared in an outer block"
471+
}
470472
cat_comp(_, comp_field(*)) { mut_str + " field" }
471473
cat_comp(_, comp_tuple) { "tuple content" }
472474
cat_comp(_, comp_res) { "resource content" }
@@ -519,4 +521,4 @@ fn inherent_mutability(ck: comp_kind) -> mutability {
519521
comp_tuple | comp_res | comp_variant(_) {m_imm}
520522
comp_field(_, m) | comp_index(_, m) {m}
521523
}
522-
}
524+
}

0 commit comments

Comments
 (0)