diff --git a/diesel_derives/src/lib.rs b/diesel_derives/src/lib.rs index 7805f8bb0774..6c28ba04a197 100644 --- a/diesel_derives/src/lib.rs +++ b/diesel_derives/src/lib.rs @@ -906,6 +906,17 @@ pub fn derive_valid_grouping(input: TokenStream) -> TokenStream { /// # } /// ``` /// +/// ## Panics +/// +/// If an implementation of the custom function panics and unwinding is enabled, the panic is +/// caught and the function returns to libsqlite with an error. It cannot propagate the panics due +/// to the FFI bounary. +/// The function or closure is internally wrapped in an +/// [`AssertUnwindSafe`](std::panic::AssertUnwindSafe). Its implementation must take care of +/// unwind-safety to avoid logic bugs on panic. +/// +/// This also holds for [custom aggregate functions](#custom-aggregate-functions). +/// /// ## Custom Aggregate Functions /// /// Custom aggregate functions can be created in SQLite by adding an `#[aggregate]`