Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
A Brief History of Rust's Orphan Rules #1
Please comment if I missed anything significant.
Apr 2014 - RFC #48 "Trait reform" covers a lot of ground, but one of its many goals was to "Expand coherence rules to operate recursively and distinguish orphans more carefully." I think this is the first RFC to explicitly define and discuss coherence, and state that it's enforced through a combination of overlap and orphan rules.
Jun 2014 - RFC #127 "Opt-in builtin traits, take 2: default and negative impls" is posted. At least for me, it's much easier to understand the special case here than it was in RFC #19: "Negative impls are subject to the usual orphan rules, but they are permitting to be overlapping. This makes sense because negative impls are not providing an implementation ..."
Jan 2015 - RFC #586 "Negative bounds" is posted. Technically only changes the overlap rules, not the orphan rules, but this might cover some of the use cases that make people suggest orphan rule changes.
Jan 2015 - Niko's "Little Orphan Impls" blog post. If you're still wondering why coherence/orphan rules are such a hard problem, this is the one link you should definitely read.
Mar 2015 - RFC #1023 "Rebalancing Coherence" is posted. This is the RFC that introduced the #[fundamental] attribute. It was accepted and implemented a month later in April.
Apr 2015 - RFC #586 "Negative bounds" is postponed because "There is too much in flight."
Apr 2015 - RFC #1023 "Rebalancing Coherence" is accepted and implemented.
May 2015 - Rust 1.0 released.
Jun 2015 - RFC #1148 "Mutually exclusive traits" is posted.
Jun 2015 - RFC #1210 "impl specialization" is posted. Technically only changes the overlap rules, not the orphan rules, but this might cover some of the use cases that make people suggest orphan rule changes.
Feb 2016 - RFC #1210 "impl specialization" is accepted.
Apr 2016 - RFC #1148 "Mutually exclusive traits" is postponed because "it makes sense to wait until the specialization implementation has progressed a bit farther before we make any decision here." but "there will be a role for negative reasoning", and "the broad outlines of this RFC are correct."
Jan 2017 - Rust issue #1856 "Orphan rules are stricter than we would like" is created, and most of the discussion on it happens this same month. This appears to contain the most recent opinions of several core team members on the precise orphan rules and how to improve them.
May 2017 - RFC #2451 "Re-Rebalancing Coherence" is posted.
Jul 2017 - RFC #2052 "Evolving Rust through Epochs" is posted. I'm including this because of the explicit statement that "Trait coherence rules, like the "orphan" rule" cannot be changed via editions.
Apr 2018 - Aturon's "Sound and ergonomic specialization for Rust" blog post. There are many other blog posts about why specialization soundness is hard, but I think this is the most recent one and represents the current status.
Oct 2018 - RFC #2451 "Re-Rebalancing Coherence" is accepted.