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

Trick to modify widely implemented traits #9

Closed
madsmtm opened this issue Nov 19, 2021 · 1 comment
Closed

Trick to modify widely implemented traits #9

madsmtm opened this issue Nov 19, 2021 · 1 comment

Comments

@madsmtm
Copy link

madsmtm commented Nov 19, 2021

raw-window-handle is used as a bridge between window "provider" and window "consumer" crates. As of writing it has 82 reverse dependencies.

The main trait HasRawWindowHandle has changed from version 0.3 to 0.4, specifically the return type of a method is a bit different.

But adding a blanket impl<T: New> Old for T means that all "provider" crates will be able to upgrade to 0.4 without breaking changes (because by implementing the new trait, they still implement the old one), see rust-windowing/raw-window-handle#74.

Once most "provider" crates have upgraded, "consumer" crates can make a breaking change and require the new trait, but the breakage will be minimal because most "provider" crates already implement the new trait.

I'm posting this here in case anyone has some input on my reasoning, and maybe someone else can use this instance of the semver trick in the future.

@dtolnay
Copy link
Owner

dtolnay commented Jul 16, 2022

Thanks for sharing!

@dtolnay dtolnay closed this as completed Jul 16, 2022
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

No branches or pull requests

2 participants