Suppress future incompatibility lint in CloneToAny impl#2
Conversation
There's a new future incompatibility warning that recently started firing on the code in CloneToAny (see [1]). It's triggering on code that does a pointer cast from *mut dyn Trait to *mut dyn Trait + Send (or other auto trait) which is an exact match for what this crate is doing. The lint doesn't actually apply here though so it is safe to suppress it. The recommended way to suppress it is to replace the pointer cast with a transmute and that's what I have done here. See the new safety comment for a more detailed explanation of why it is safe. [1]: rust-lang/rust#127323
|
@reivilibre any update here ? If you do need some help with maintaining the crate I can try to do some maintanace work, or maybe ask someone like rust-lang-owner to join the crate :) |
|
I would be happy to pitch in with maintenance as well. At this point, though, it may be worth asking the rust-lang folks if they would be willing to maintain an official anymap fork under the |
|
Admittedly I didn't become aware of this PR until the mention from @xMAC94x, maybe I have my notification settings set poorly for GitHub. But at that point I was on holiday and forgot since. |
|
Why don't we get this PR merged and released so that the lint gets resolved in downstream crates. After that I'm happy to either help maintain this crate or to ask around on the rust-lang zulip to see if there is interest in moving it into the rust-lang org (or both!). |
|
Thank you, particularly for waiting such a long time. I took the time to read the change carefully given it was in unsafe code, I don't see anything wrong with it. |
|
I published this in |
There's a new future incompatibility warning that recently started firing on the code in CloneToAny (see 1). It's triggering on code that does a pointer cast from *mut dyn Trait to *mut dyn Trait + Send (or other auto trait) which is an exact match for what this crate is doing.
The lint doesn't actually apply here though so it is safe to suppress it. The recommended way to suppress it is to replace the pointer cast with a transmute and that's what I have done here.
See the new safety comment for a more detailed explanation of why it is safe.