jaemk / cached

Rust cache structures and easy function memoization

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nightly rust (1.64.0) reports cached functions as dead code.

BlackDex opened this issue · comments

Hello there,

First, thanks for this crate, using it with Vaultwarden to speedup some calls which works great.

I sometimes test future clippy results and see if i can fix them upfront already.
When i tried this with the current nightly v1.64.0, it reports that the functions which are cached are dead-code, and during compile it reports those functions are never used. Now i don't know if this is something related to a new way Rust works, or that something need to be changed to this crate maybe.

It looks like false positives to me, since it seem to still work.

This isn't happening on stable or beta, only on nightly.

Thanks for reporting! Maybe we need to add an #[allow(unused)] or whatever the flag is to all the generated methods, here's one spot for example

#visibility #signature_no_muts {

The report is for *_prime_cache functions.
So I think it's the lines like this one, then:

#[doc = #prime_fn_indent_doc]