Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress future incompatibility lint in CloneToAny impl #2

Merged
merged 1 commit into from
Nov 9, 2024

Conversation

swlynch99
Copy link

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.

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
@xMAC94x
Copy link

xMAC94x commented Oct 17, 2024

@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 :)

@swlynch99
Copy link
Author

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 rust-lang org. I believe they may actually be interested in doing that.

@reivilibre
Copy link
Owner

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.
However I would be happy to have it maintained under the rust-lang org or something similar like that

@swlynch99
Copy link
Author

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!).

@reivilibre reivilibre self-assigned this Nov 9, 2024
@reivilibre reivilibre merged commit 075713a into reivilibre:master Nov 9, 2024
@reivilibre
Copy link
Owner

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.

@reivilibre
Copy link
Owner

I published this in 1.0.1

@swlynch99 swlynch99 deleted the fix-future-incompat-lint branch November 11, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants