I have a similar problem with a project of a different language.
As far as I was able to analyze it, this is due to how the dates of the files are checked.
The unzipped files from the cache all have their proper timestamps, but the checked out files from the git repository all have a current creation timestamp and therefore appear to be newer than their cached artifacts to the compiler.
I have not found a way around this. At least for my project the cache worked for the artifcats of dependencies, which solved most of my compile time issues.
For my rust project I have not yet tried to set up caching.
The documentation is quite clear that there no guarantee is made on cache availability (It surprised me at first too)
Caching is an optimization, but isn't guaranteed to always work, so you need to be prepared to regenerate any cached files in each job that needs them.
Assuming you have properly defined cache in .gitlab-ci.yml according to your workflow, the availability of the cache ultimately depends on how the Runner has been configured (the executor type and whether different Runners are used for passing the cache between jobs)
Cache was available during this job. You can see that cached artifacts from previous build are present, but rust still decides to recompile. Cache availability is not the problem here.