diff --git a/examples/issue32.rs b/examples/issue32.rs new file mode 100644 index 0000000..ba34a47 --- /dev/null +++ b/examples/issue32.rs @@ -0,0 +1,11 @@ +use memoize::memoize; + +#[memoize] +fn expensive(mut foo: i32) -> i32 { + foo += 1; + foo +} + +fn main() { + expensive(7); +} diff --git a/inner/src/lib.rs b/inner/src/lib.rs index c7d708b..1ce5efe 100644 --- a/inner/src/lib.rs +++ b/inner/src/lib.rs @@ -435,7 +435,7 @@ pub fn memoize(attr: TokenStream, item: TokenStream) -> TokenStream { #flusher #store - #[allow(unused_variables)] + #[allow(unused_variables, unused_mut)] #vis #sig { #memoizer }