]> git.lizzy.rs Git - rust.git/blobdiff - src/libpanic_unwind/emcc.rs
Apply review feedback
[rust.git] / src / libpanic_unwind / emcc.rs
index 61f33fd4d5d664dc02d3af55c6c7662d06daee69..fbadf4ac6a058dd50e1d4a01789c917f3132b600 100644 (file)
@@ -53,6 +53,10 @@ pub fn payload() -> *mut u8 {
 }
 
 struct Exception {
+    // This needs to be an Option because the object's lifetime follows C++
+    // semantics: when catch_unwind moves the Box out of the exception it must
+    // still leave the exception object in a valid state because its destructor
+    // is still going to be called by __cxa_end_catch..
     data: Option<Box<dyn Any + Send>>,
 }