Specializing on `Copy`

⚓ Rust    📅 2025-06-26    👤 surdeus    👁️ 6      

surdeus

Warning

This post was published 47 days ago. The information described in this article may have changed.

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Specializing on `Copy`

Does anyone know of techniques to specialize on Copy specifically in stable Rust? I am currently using the typeid crate to test whether a type is one of a known set of Copy types that are likely to be used with my library. Reading the Rust issues I have seen mentions of some libraries using hacks which rely on the fact that some standard library methods won't call the Clone impl for a type if it also implements Copy, but this is a cause for sadness amongst the stdlib maintainers.

(Edit: Fixed issue link)

1 post - 1 participant

Read full topic

🏷️ rust_feed