diff options
| author | Urgau <urgau@numericable.fr> | 2025-06-16 18:29:37 +0200 |
|---|---|---|
| committer | Urgau <urgau@numericable.fr> | 2025-06-16 19:58:01 +0200 |
| commit | 994794a50bd4adfd7f0351872206e170c1bc8d58 (patch) | |
| tree | 6ad9e4b8ba9e8a829911cdec3a049a4dfc299c48 /compiler | |
| parent | d9ca9bd014074e2bac567eaa2b66bfacb2591028 (diff) | |
| download | rust-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.rs | 5 |
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. |
