-
Notifications
You must be signed in to change notification settings - Fork 111
Add a Library Trait Evolution experiment #689
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
Open
lcnr
wants to merge
10
commits into
rust-lang:main
Choose a base branch
from
lcnr:library-trait-evolution
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+53
−8
Open
Changes from 5 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ff09d34
remove unnecessary comments
lcnr 1e1d84b
add a library trait evolution initiative goal
lcnr d16ecba
cool
lcnr 6f883c1
wooops
lcnr 4cac4ef
Update src/2026/library-trait-evolution-initiative.md
lcnr 27b6b69
Add tmandry as the lang champion
tomassedovic fe66f88
s/initiative/experiment/g
tomassedovic f5e49fc
Shorten the goal's Zulip channel body
tomassedovic 544603f
Change "initiative" to "experiment" in the filename too
tomassedovic 12687d0
add myself as types champion
lcnr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Library Trait Evolution Initiative | ||
|
|
||
|
|
||
| | Metadata | | | ||
| | :--------------- | -------------------------------------------------------------------------------- | | ||
| | Point of contact | @lcnr | | ||
| | What and why | Enable library authors to more easily change their trait definitions | | ||
| | Status | Proposed | | ||
| | Tracking issue | | | ||
| | Zulip channel | N/A (an existing stream can be re-used or new streams can be created on request) | | ||
| | Funding contact | [Hexcat](https://hexcat.nl/) | | ||
|
|
||
| ## Summary | ||
|
|
||
| Setup a Library Trait Evolution Initiative. This initiative works to unify the design of language features to make trait definitions less rigid. This includes [refined trait implementations](https://github.com/rust-lang/rfcs/pull/3245) and [Supertrait Auto-impl](https://github.com/rust-lang/rfcs/pull/3851), but also more targeted features for the standard library, such as [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/issues/107460). | ||
|
|
||
| We plan to collect different use-cases and requirements here, both from the standard library and the wider ecosystem. We then use this to design, implement, and stabilize features solving these issues. | ||
|
|
||
| ## Motivation | ||
|
|
||
| ### The status quo | ||
|
|
||
| Trait evolution and trait hierarchy refactoring is a long-time pain point for Rust crates and especially the standard library. As crates evolve and grow, needs to restructure trait hierarchy to accommodate richer functionality often arises, both in the standard library and the broader Rust ecosystem. | ||
|
|
||
| This will be even more of an issue once we add new *implicit default auto trait bounds* to support [Immobile types and guaranteed destructors](https://rust-lang.github.io/rust-project-goals/2026/move-trait.html) or the [Sized Hierarchy](https://rust-lang.github.io/rust-project-goals/2026/scalable-vectors.html). For example in `trait Trait { fn foo<T>(); }` the generic parameter `T` will get an implicit `T: Move` bound whose removal is a breaking change. This makes immobile types a lot less useable with existing traits. | ||
|
|
||
| ### Work items over the next year | ||
|
|
||
|
|
||
| | Task | Owner(s) | Notes | | ||
| | ----------- | -------- | ----- | | ||
| | Setup a Library Trait Evolution Initiative and create its repository | @lcnr | | ||
| | Collect and explore different use-cases in a single repository | @lcnr | | ||
| | Collaborate on the design and implementation of language features to solve these issues | @lcnr | | ||
|
|
||
|
|
||
| ## Team asks | ||
|
|
||
| | Team | Support level | Notes | | ||
| | ---------- | ------------- | --------------------------------------- | | ||
| | [lang] | Medium | Probably want to have a lang meeting at some point | | ||
| | [libs] | Small | We would like to test some of the desired standard library changes and get input on the design | | ||
| | [types] | Medium | Review and discuss type system changes if required | | ||
|
|
||
| ## Funding | ||
|
|
||
| | Purpose | Cost | Funded | Sponsor(s) | | ||
| |-------------------|------|--------|----------------| | ||
| | Contributor | Ask | Partial | | | ||
|
|
||
| ## Frequently asked questions | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.