Will try! disappear in a future version of Rust?

Hi all,

I was just reading the release notes for the newly released Rust 1.39.0 and noticed that it says:

If I understand correctly, users have the option of passing --allow deprecated to rustc in order to ignore deprecation warnings. That's probably okay if someone wants to compile code written a few years ago with the currently stable compiler.

However, will the try! macro ever go away?

Ah, it just occurred to me that the macro will stay around as long as compilers support the Rust 2015 edition, right?

As I understand the published Rust stability guarantees, try! does have to stick around forever, at least on the existing 2015 and 2018 editions. Deprecation doesn't mean removal is planned, just that you should stop using it because there are better alternatives now. The relevant RFC even specifies that "renaming/moving/removing any public items" is a "major change," even if the items are deprecated.

The cases I'm aware of where outright removal is allowed are compiler bugfixes and soundness fixes, and try! obviously isn't one of those.

1 Like

Also, the edition RFC doesn't allow breaking changes to standard libraries. All editions share the same version of libstd.

1 Like

Thanks for the explanations, makes sense!