-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uses of "do catch" suggest non-working "try" instead #53672
Comments
cc @scottmcm |
@RalfJung Oh, right, the error message should mention that you need to be in the 2018 edition. (I could also make |
So is |
@durka It was never the plan to stabilize |
@durka Do you have a case where you have nightly 2015 code that cannot migrate to nightly 2018? |
I'm confused. Even with #![feature(rust_2018_preview)] the syntax let foo: Result<_, _> = try {
// ...
}; still does not work? |
Ahh, it looks like you also need |
This was very confusing to run into (for some reason this error occurs on Travis, but not locally for me). It'd make much more sense to me to allow |
Add a note about 2018e if someone uses `try {` in 2015e Inspired by rust-lang#58491, where a `try_blocks` example was accidentally run in 2015, which of course produces a bunch of errors. What's the philosophy about gating for this? The keyword is stably a keyword in 2018, so I haven't gated it for now but am not mentioning what the keyword _does_. Let me know if I should do differently. Resolves rust-lang#53672
Add a note about 2018e if someone uses `try {` in 2015e Inspired by rust-lang#58491, where a `try_blocks` example was accidentally run in 2015, which of course produces a bunch of errors. What's the philosophy about gating for this? The keyword is stably a keyword in 2018, so I haven't gated it for now but am not mentioning what the keyword _does_. Let me know if I should do differently. Resolves rust-lang#53672
I've closed this now that there's an additional message about the edition on Have you perchance been able to use |
Yes, they seem to work as intended. :) |
I have code like this
after updating nightly, this does not compile any more. It says
So I tried
but that does not compile either
I have also tried
try catch
, to no avail.At the very least, the error message about "do catch" needs to be improved, as its advise is clearly incorrect. But also, I wonder what I should do now :D I guess I'll use an immediately-applied closure again...
The text was updated successfully, but these errors were encountered: