-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Find a way to detect API breakage. #17152
Copy link
Copy link
Closed
Description
Given that the current rust ecosystem tries very hard to force everyone to use semver, and given that rust code breaks the API easily, this is very important.
Some easy but surprising ways to break the API:
- Adding a field to a struct.
- Changing a struct from Copy to NoCopy (same with Send, Sync, etc.)
- Adding a variant to an enum.
- Adding a public method to a type (consider extension traits)
- Adding a method to a trait (consider Conflicting method names in the same trait hierachy can only ever be called with UFCS syntax #17151)
Therefore rustc needs to have something like this:
rustc --record-api out.json lib_old.rs
stores api information in out.json
rustc --compare-api out.json lib_new.rs
Checks if the new api is compatible with the old one.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.