Skip to content

Commit 274912a

Browse files
committed
Expanded comment: we do not emit StorageDead on diverging paths, ...
... but that end behavior might not be desirable.
1 parent 3dd77f4 commit 274912a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/librustc_mir/build/scope.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,12 @@ fn build_diverge_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
783783
for drop_data in &mut scope.drops {
784784
// Only full value drops are emitted in the diverging path,
785785
// not StorageDead.
786+
//
787+
// Note: This may not actually be what we desire (are we
788+
// "freeing" stack storage as we unwind, or merely observing a
789+
// frozen stack)? In particular, the intent may have been to
790+
// match the behavior of clang, but on inspection eddyb says
791+
// this is not what clang does.
786792
let cached_block = match drop_data.kind {
787793
DropKind::Value { ref mut cached_block } => cached_block,
788794
DropKind::Storage => continue

0 commit comments

Comments
 (0)