Switch from try!() to ? in generated code to make it work in Rust 2018#109
Merged
dwrensha merged 1 commit intocapnproto:masterfrom Oct 6, 2018
Merged
Switch from try!() to ? in generated code to make it work in Rust 2018#109dwrensha merged 1 commit intocapnproto:masterfrom
dwrensha merged 1 commit intocapnproto:masterfrom
Conversation
Rust 2018 removes the `try!()` macro and makes `try` a reserved keyword in accordance with RFC 2388: rust-lang/rfcs#2388. On the other hand, the `?` operator was introduced way back in Rust 1.13 and is now stable. Without the change, rustc will refuse to compile the generated code starting with the 2018 edition. While this project itself is free to use `try!()` and not switch to Rust 2018, its output files - preferably - should be compatible with both editions. rust-lang/rust#31436
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rust 2018 removes the
try!()macro and makestrya reserved keyword in accordance with RFC 2388. On the other hand, the?operator was introduced way back in Rust 1.13 and is now stable.Without the change, rustc will refuse to compile the generated code starting with the 2018 edition:
While this project itself is free to use
try!()and not switch to Rust 2018, its output files - preferably - should be compatible with both editions.rust-lang/rust#31436