Skip to content

Commit e612f7a

Browse files
Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
1 parent 20a1315 commit e612f7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl BorrowExplanation {
119119
let path_span = path_span.unwrap();
120120
// path_span is only present in the case of closure capture
121121
assert!(matches!(later_use_kind, LaterUseKind::ClosureCapture));
122-
if !borrow_span.map_or(false, |sp| sp.overlaps(var_or_use_span)) {
122+
if borrow_span.map(|sp| !sp.overlaps(var_or_use_span)).unwrap_or(true) {
123123
let path_label = "used here by closure";
124124
let capture_kind_label = message;
125125
err.span_label(

0 commit comments

Comments
 (0)