]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_borrowck/borrowck/mod.rs
Auto merge of #35166 - nikomatsakis:incr-comp-ice-34991-2, r=mw
[rust.git] / src / librustc_borrowck / borrowck / mod.rs
index 4b9562ca299fd15327a6574ba364284b91b38f77..904cffac6b3cd88e06b21391382e9f198f3a22b1 100644 (file)
@@ -944,9 +944,12 @@ fn report_out_of_scope_escaping_closure_capture(&self,
                           but it borrows {}, \
                           which is owned by the current function",
                          cmt_path_or_string)
-            .span_note(capture_span,
+            .span_label(capture_span,
                        &format!("{} is borrowed here",
                                 cmt_path_or_string))
+            .span_label(err.span,
+                       &format!("may outlive borrowed value {}",
+                                cmt_path_or_string))
             .span_suggestion(err.span,
                              &format!("to force the closure to take ownership of {} \
                                        (and any other referenced variables), \