How do you feel about Copy trait being hidden away? #rust-analyzer
I've been using Rust for a while now, but one thing has been bugging me ever since I started - the Copy trait exists on some structs without any explicit surface level warning/annotation.
I initially brushed it off, thinking that there must be a reason why it is the way it is, you can just remember the basic Rust types that implement it.
But then you get to libraries. Does a certain struct implement Copy? Well, in VSCode you can peek the implementation, see if Copy is in the derive block. Not the most ergonomic solution, not too bad either.
But that's bulletproof. When I was working with a very popular library (don't remember the exact one, might've been rusqlite), Copy wasn't in the derive block, so I assumed that it wasn't implemented. Wrong. It was implemented somewhere at the bottom, because they were making a custom implementation - found that out later. This means that really you should peek every implementation and Ctrl+F for "Copy" to be sure.
So with that in mind, don't you think that right now Copy is too hidden/implicit? This is more about rust analyzer rather than Rust itself. On-hover tooltip could show "implements Copy" at the top, or show all traits at the bottom, or have a separate button to list all traits.
To me personally it still feels very wrong that in a language where we always explicitly track data ownership, we have this thing that fundamentally affects ownership and requires a multi step workflow to check for.
Also, what's your solution/workaround to this? The most workable one I found is the setting in rust analyzer to show moves explicitly in your code. Though I don't use it. Don't want the added verbosity, I just need to check specific structs, so for now I'm still using the peek + Ctrl+F (which honestly sucks, too much friction for checking something this important).