mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 19:58:32 +00:00
Update compiler/rustc_mir/src/borrow_check/diagnostics/explain_borrow.rs
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
This commit is contained in:
parent
20a1315cbb
commit
e612f7abfc
@ -119,7 +119,7 @@ impl BorrowExplanation {
|
|||||||
let path_span = path_span.unwrap();
|
let path_span = path_span.unwrap();
|
||||||
// path_span is only present in the case of closure capture
|
// path_span is only present in the case of closure capture
|
||||||
assert!(matches!(later_use_kind, LaterUseKind::ClosureCapture));
|
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 path_label = "used here by closure";
|
||||||
let capture_kind_label = message;
|
let capture_kind_label = message;
|
||||||
err.span_label(
|
err.span_label(
|
||||||
|
Loading…
Reference in New Issue
Block a user