about summary refs log tree commit diff
path: root/compiler/rustc_borrowck/src/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-07-12 03:40:38 +0000
committerbors <bors@rust-lang.org>2024-07-12 03:40:38 +0000
commitb286722878e18db29a7fbe672be7c4d3b02e8e4d (patch)
treecebcce1687ff40e7478d1f013b0d1b70b94c2cda /compiler/rustc_borrowck/src/lib.rs
parent4a31a6c32a9a0e726516b1086f33e3d4a37dc94c (diff)
parentc2b7842555b89d6c254abf51857f7364fa9cc0c4 (diff)
downloadrust-b286722878e18db29a7fbe672be7c4d3b02e8e4d.tar.gz
rust-b286722878e18db29a7fbe672be7c4d3b02e8e4d.zip
Auto merge of #127635 - matthiaskrgr:rollup-foopajr, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #127164 (match lowering: Clarify the main loop of the algorithm)
 - #127422 (as_simd: fix doc comment to be in line with align_to)
 - #127596 (More suggestion for converting `Option<&Vec<T>>` to `Option<&[T]>`)
 - #127607 (compiletest: Better error message for bad `normalize-*` headers)
 - #127622 (Mark `builtin_syntax` as internal)
 - #127625 (Revert accidental comment deletion)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_borrowck/src/lib.rs')
-rw-r--r--compiler/rustc_borrowck/src/lib.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs
index d258c68b959..9ad941dabbe 100644
--- a/compiler/rustc_borrowck/src/lib.rs
+++ b/compiler/rustc_borrowck/src/lib.rs
@@ -821,6 +821,8 @@ impl<'a, 'mir, 'tcx, R> rustc_mir_dataflow::ResultsVisitor<'mir, 'tcx, R>
             | TerminatorKind::Return
             | TerminatorKind::TailCall { .. }
             | TerminatorKind::CoroutineDrop => {
+                // Returning from the function implicitly kills storage for all locals and statics.
+                // Often, the storage will already have been killed by an explicit
                 // StorageDead, but we don't always emit those (notably on unwind paths),
                 // so this "extra check" serves as a kind of backup.
                 let borrow_set = self.borrow_set.clone();