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

Do a Crater run with all public *Ext traits in std sealed #80634

Closed
camelid opened this issue Jan 3, 2021 · 3 comments
Closed

Do a Crater run with all public *Ext traits in std sealed #80634

camelid opened this issue Jan 3, 2021 · 3 comments
Labels
S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@camelid
Copy link
Member

camelid commented Jan 3, 2021

I’d be in favor of trying out in Crater a PR that "seals" all public *Ext traits in the standard library.

Originally posted by @SimonSapin in #77728 (comment)

@camelid camelid added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Jan 3, 2021
@SimonSapin
Copy link
Contributor

With a bit more context: the "sealed trait" pattern is https://rust-lang.github.io/api-guidelines/future-proofing.html#sealed-traits-protect-against-downstream-implementations-c-sealed and aims to prevent crates other than the one defining a trait from implementing it. This in turns allows adding new method to that trait after it is stable. (Which would otherwise break those external implementations.)

*Ext are "extension traits" that add methods to one or a few types. They are typically not intended to for external crates to add more implementations and it’s not clear that doing could be useful to anyone, but without the sealed pattern there’s nothing to prevent it.

@lygstate
Copy link
Contributor

lygstate commented Jan 3, 2021

With a bit more context: the "sealed trait" pattern is https://rust-lang.github.io/api-guidelines/future-proofing.html#sealed-traits-protect-against-downstream-implementations-c-sealed and aims to prevent crates other than the one defining a trait from implementing it. This in turns allows adding new method to that trait after it is stable. (Which would otherwise break those external implementations.)

*Ext are "extension traits" that add methods to one or a few types. They are typically not intended to for external crates to add more implementations and it’s not clear that doing could be useful to anyone, but without the sealed pattern there’s nothing to prevent it.

Do I need to wait this to be finished?

@Enselic
Copy link
Member

Enselic commented Dec 17, 2023

Triage: crater run performed in #81213

@Enselic Enselic closed this as completed Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants