the target directory is per workspace, not per package. if you only use them as dependencies, cargo should not put files there, unless you run cargo commands directly in the directory.
I think most likely, you might have accidentally opened the source code in your editor and rust-analyzer invoked commands like cargo metadata or cargo check.