Closed skade closed 3 years ago
That pattern was actually fine though, wasn't it?
Since you never use Bar
by value, you use it behind a raw pointer, which is thus !Send, !Sync, and Pinning wouldn't apply.
I think a bigger (and possibly more controversial) issue is not discouraging using these types by value/reference, which is likely UB under the current aliasing semantics (although it is a thing people do...)
As it is, I've seen people confused about the reasoning here, and IDK if this change makes things clearer.
Fix for #250.
Final pattern derived by @nvzqz, with help from @dtolnay.