From 5eb823896f01146df0d4ed6c296ef7dd445ccbbf Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 1 Apr 2023 15:27:09 +0200 Subject: fix: make expectation returning method unsafe --- macros/src/expectation.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'macros') diff --git a/macros/src/expectation.rs b/macros/src/expectation.rs index 2e86db0..d724655 100644 --- a/macros/src/expectation.rs +++ b/macros/src/expectation.rs @@ -439,8 +439,14 @@ impl ToTokens for Expectation } } + /// Sets the function that will be called to provide the return value of + /// this expectation. + /// + /// # Safety + /// The caller must ensure that no argument or return type is outlived. They must + /// be treated as if they are bound to 'static. #[allow(unused)] - pub fn returning( + pub unsafe fn returning( &mut self, func: #returning_fn ) -> &mut Self -- cgit v1.2.3-18-g5258