For types which implement Deref
, change some methods to associated functions?
#210
Labels
blocking-next-release
This issue should be resolved before we release on crates.io
compatibility-breaking
Changes that are (likely to be) breaking
We have some types (such as
Ref
andUnalign
) which implementDeref
, and which provide methods (such asinto_ref
). This conflicts with the standard library's pattern of preferring associated functions over methods on types which implementDeref
(e.g.,Box::into_raw
). This pattern is well-motivated: When a method is called on aDeref
type, it is resolved on both the type itself and the target type (e.g., on bothBox<T>
and onT
), and so methods on the type itself (Box<T>
) can conflict with those on the target type (T
). We should consider adopting this pattern.The text was updated successfully, but these errors were encountered: