about summary refs log tree commit diff
path: root/compiler/rustc_borrowck
diff options
context:
space:
mode:
authorxizheyin <xizheyin@smail.nju.edu.cn>2025-07-22 00:20:52 +0800
committerxizheyin <xizheyin@smail.nju.edu.cn>2025-07-29 14:54:47 +0800
commit81176b1a6c3a40b2db42821f209cf834befad77e (patch)
tree22b00bc135ae25a3a3e6a99991348c2d225e91d4 /compiler/rustc_borrowck
parentcb6785f73df1aa3f558796a22a4ab9652cf38e26 (diff)
downloadrust-81176b1a6c3a40b2db42821f209cf834befad77e.tar.gz
rust-81176b1a6c3a40b2db42821f209cf834befad77e.zip
Create two methods to fix `find_oldest_ancestor_in_same_ctxt`
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Diffstat (limited to 'compiler/rustc_borrowck')
-rw-r--r--compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
index a10da08ddf3..fdca6b56540 100644
--- a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
+++ b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs
@@ -341,7 +341,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
                                 }
                             }
                         } else if let LocalInfo::BlockTailTemp(info) = local_decl.local_info() {
-                            let sp = info.span.find_oldest_ancestor_in_same_ctxt();
+                            let sp = info.span.find_ancestor_not_from_macro().unwrap_or(info.span);
                             if info.tail_result_is_ignored {
                                 // #85581: If the first mutable borrow's scope contains
                                 // the second borrow, this suggestion isn't helpful.