Skip to content

Commit b987f45

Browse files
committed
Expanded comment: we do not emit StorageDead on diverging paths, ...
... but that end behavior might not be desirable.
1 parent 5cc0984 commit b987f45

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
@@ -781,6 +781,12 @@ fn build_diverge_scope<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
781781
for drop_data in &mut scope.drops {
782782
// Only full value drops are emitted in the diverging path,
783783
// not StorageDead.
784+
//
785+
// Note: This may not actually be what we desire (are we
786+
// "freeing" stack storage as we unwind, or merely observing a
787+
// frozen stack)? In particular, the intent may have been to
788+
// match the behavior of clang, but on inspection eddyb says
789+
// this is not what clang does.
784790
let cached_block = match drop_data.kind {
785791
DropKind::Value { ref mut cached_block } => cached_block,
786792
DropKind::Storage => continue

0 commit comments

Comments
 (0)