about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-05-22 14:40:47 -0400
committerNiko Matsakis <niko@alum.mit.edu>2017-05-22 14:40:47 -0400
commit8a4e5933df9a9252080f445b29621acc4afb459a (patch)
tree0cca47126dd9408870042064a9282ff3d562e5ef /src
parent19bf544b25c5a68d4fef5b948d6dc03613966f14 (diff)
downloadrust-8a4e5933df9a9252080f445b29621acc4afb459a.tar.gz
rust-8a4e5933df9a9252080f445b29621acc4afb459a.zip
add arielb1 example
Diffstat (limited to 'src')
-rw-r--r--src/librustc_mir/build/scope.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs
index 0b1d411d96e..a99e7b4be57 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<CodeExtent> {