Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Switch from try!() to ? in generated code to make it work in Rust 2018 #109

Merged
merged 1 commit into from
Oct 6, 2018

Conversation

bmisiak
Copy link
Contributor

@bmisiak bmisiak commented Oct 6, 2018

Rust 2018 removes the try!() macro and makes try a 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:

expected expression, found reserved keyword `try`

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

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
@dwrensha dwrensha merged commit 395cb66 into capnproto:master Oct 6, 2018
@dwrensha
Copy link
Member

dwrensha commented Oct 6, 2018

Thanks!

vhdirk pushed a commit to vhdirk/capnproto-rust that referenced this pull request May 8, 2019
Switch from try!() to ? in generated code to make it work in Rust 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants