Why are zero-sized clones of function items useful?
⚓ Rust 📅 2025-06-12 👤 surdeus 👁️ 12OP of an internals thread wrote:
I can see the value of being able to .clone() a function item and get a zero sized result, so the coercion shouldn't happen in all cases.
What is the practical use of zero-sized clones of function items in Rust? It seems that if it wasn't for such use cases, function items could automatically be coerced to function pointers by the compiler.
3 posts - 2 participants
🏷️ rust_feed