Closed
Description
This would be a tool to guarantee stability and backwards-compatibility of core library interfaces. It takes a rust source file (the 'spec') that declares the item's and pub uses
in core, without implementation. It then parses both the spec and the library and compares them. Any mismatches are errors. Report various metrics about stable/unstable APIs.
The goal is to make it very difficult to change interfaces that are stable. The downside is that you have to ultimately redeclare all of core.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
brson commentedon May 15, 2013
I'd be interested to hear other ideas on this topic.
thestinger commentedon May 15, 2013
This would be neat, there are a lot of bits of the container interfaces that definitely aren't ever going to change (everything in Container/Map/Set that isn't an iterator).
I'd like to be able to mark them as stable, even if it was somewhat painful/redundant.
brson commentedon May 16, 2013
After thinking about this further let's adopt node's stability levels. We can use attributes to tag items. The tool then would periodically extract the public item signatures, exporting them to a file or comparing them against a file. Approved API changes would then need to use the tool to regenerate the signatures file and check it in. Depending on how elaborate you want the tool's reporting to be there could be overlap in functionality with rustdoc.
brson commentedon May 16, 2013
The compiler can also warn about using unstable, experimented, deprecated apis.
brson commentedon May 16, 2013
If there is already a
#[deprecated]
attribute let's fold that in to the stability levels attributes.brson commentedon May 16, 2013
If we wanted to validate test coverage for stable features this would probably be the tool for that as well.
brson commentedon Jun 1, 2013
I've started work on this in my
apilock
branch.metajack commentedon Aug 8, 2013
visiting for triage. nothing to add.
huonw commentedon Jan 12, 2014
Triage: we now have semi-supported stability attributes, nothing else to add.
alexcrichton commentedon Sep 29, 2014
cc rust-lang/cargo#374
steveklabnik commentedon Feb 15, 2015
Triage: we have stability attributes for this purpose, and while it's not quite the same thing, it's working at the moment. I feel like this may be a conceptual dup of another issue relating to stability detection, but I'm not sure, so leaving it open for now.
steveklabnik commentedon Apr 28, 2015
Revisiting a few months later, we have a good story with how we ensure lack of breakage here, through stability attributes. So giving this a close.