about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorUrgau <urgau@numericable.fr>2025-06-16 18:29:37 +0200
committerUrgau <urgau@numericable.fr>2025-06-16 19:58:01 +0200
commit994794a50bd4adfd7f0351872206e170c1bc8d58 (patch)
tree6ad9e4b8ba9e8a829911cdec3a049a4dfc299c48 /compiler
parentd9ca9bd014074e2bac567eaa2b66bfacb2591028 (diff)
downloadrust-994794a50bd4adfd7f0351872206e170c1bc8d58.tar.gz
rust-994794a50bd4adfd7f0351872206e170c1bc8d58.zip
Handle same-crate macro for borrowck semicolon suggestion
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
index c4b0f503664..095c0df98ac 100644
--- a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
@@ -342,10 +342,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
                                 }
                             }
                         } else if let LocalInfo::BlockTailTemp(info) = local_decl.local_info() {
-                            let sp = info
-                                .span
-                                .find_ancestor_in_same_ctxt(local_decl.source_info.span)
-                                .unwrap_or(info.span);
+                            let sp = info.span.find_oldest_ancestor_in_same_ctxt();
                             if info.tail_result_is_ignored {
                                 // #85581: If the first mutable borrow's scope contains
                                 // the second borrow, this suggestion isn't helpful.