This trait definition compiles fine:This, however, does lead to an error:With the : Sized supertrait bound, it works.
Consider the following toy example:This doesn't compile. It claims there is a lifetime issue in the implementation for partial_cmp:
I'm building a library that implements string joins; that is, printing all the elements of a container separated by a separator. My basic design looks like this:
From the book: Rust won’t let us annotate a type with the Copy trait if the type, or any of its parts, has implemented the Drop trait. If the type needs something special to happen when the value goes out of scope and we add the Copy annotation to that...