Backward Compatibility in Rust

Hi, I really love rust and I will like it to be my primary programming language. I'm confused, with many crates out there, will rust still be backward compatible ? I love Java for it backwards compatibility.
Thanks

The backward compatibility guarantees of Rust (the language itself) don't depend on external crates. What particular problem/scenario do you have in mind that would imply otherwise?

2 Likes

If a crate compiled at some point, then Rust's stability guarantees say that it'll still compile afterwards.

Now there's no guarantee that you can swap out version 1.x.x of a user provided crate with version 2.y.y and that your program still works, since that's not semver compatible.

But if a crate was written in edition e (which was released for rust version v_e) and written in rust version w, then all versions k >= w and k >= v_e, of rust will compile the crate (as long as no unstable features are used). This is ignoring the use of deprecated features, where you really should just update/patch your library, however you will get a grace period where it's a warning.

4 Likes

Rust has a tool called crater that compiles and tests every crate. It's used to verify that new versions of Rust are compatible with all crates.

https://crater.rust-lang.org/

2 Likes

Thanks, it being answered

1 Like

It's worth noting that backwards compatibility it's the same thing as having language breaking changes introduced.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.