diff options
author | HampusM <hampus@hampusmat.com> | 2023-04-01 15:27:09 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-04-01 15:27:09 +0200 |
commit | 5eb823896f01146df0d4ed6c296ef7dd445ccbbf (patch) | |
tree | 482ba87a3977f646dcff956affd47dac50a2d647 /macros/src | |
parent | ba865b581fbc1d0589b402b028f2bce70332891b (diff) |
fix: make expectation returning method unsafe
Diffstat (limited to 'macros/src')
-rw-r--r-- | macros/src/expectation.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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 |