From 8a4e5933df9a9252080f445b29621acc4afb459a Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Mon, 22 May 2017 14:40:47 -0400 Subject: [PATCH] add arielb1 example --- src/librustc_mir/build/scope.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs index 0b1d411d96efa..a99e7b4be5768 100644 --- a/src/librustc_mir/build/scope.rs +++ b/src/librustc_mir/build/scope.rs @@ -441,6 +441,14 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { /// We wish to pop the storage for X and Y after `bar()` is /// called, not after the whole `let` is completed. /// + /// As another example, if the second argument diverges: + /// + /// foo(Box::new(2), panic!()) + /// + /// We would allocate the box but then free it on the unwinding + /// path; we would also emit a free on the 'success' path from + /// panic, but that will turn out to be removed as dead-code. + /// /// When building statics/constants, returns `None` since /// intermediate values do not have to be dropped in that case. pub fn local_scope(&self) -> Option {