Skip to content

Commit

Permalink
Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs
Browse files Browse the repository at this point in the history
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
  • Loading branch information
ChrisPardy and nikomatsakis committed May 1, 2021
1 parent 20a1315 commit e612f7a
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -119,7 +119,7 @@ impl BorrowExplanation {
let path_span = path_span.unwrap();
// path_span is only present in the case of closure capture
assert!(matches!(later_use_kind, LaterUseKind::ClosureCapture));
if !borrow_span.map_or(false, |sp| sp.overlaps(var_or_use_span)) {
if borrow_span.map(|sp| !sp.overlaps(var_or_use_span)).unwrap_or(true) {
let path_label = "used here by closure";
let capture_kind_label = message;
err.span_label(
Expand Down

0 comments on commit e612f7a

Please sign in to comment.