Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Why are zero-sized clones of function items useful?
OP 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