-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
suggest ?
over try!
#1361
Comments
Some people still prefer |
I know :( but even reading the rfc and tracking issue, the only complaint I could find is visibility, and even the complainers agree that it is just a syntax hilighting issue. All in all, it is the recommended new way of doing error propagation, so I think we should suggest it. Alternatively rustfmt could silently rewrite all code that doesn't have a |
cc @mbr opinions welcome :) |
I agree, but I feel that even these are split in two camps. Some people will want to keep writing This seems like a bikeshedding issue to me at this point. The worst outcome would be having both variants common and valid, preventing me to get thoroughly used to one way or another, so for this reason please pick one and stick to it!
I'm still recovering from Though adding a flag to do this automatically might be a good idea. |
The Rust book doesn't mention |
On the day after Rust 1.13 was released, I was all about teaching |
As someone who doesn't like |
@est31 The feature was merged into rust stable. I doubt rust's main linter is going to discourage it's use, that would be counterproductive. |
Despite it's recent stability, it's still a young feature (for example codegen doesn't always return the same bytecode as with |
edit: nope, my bad |
|
|
It doesn't serve Rust that people hesitate about adopting features(*) (when they are this kind of direct replacement). You could say I voted -1 on having There is a codegen issue: rust-lang/rust#37939 (comment) . This missing simplification/optimizations also applies to the code (*) Edit: So yes, that means that Rust needs to do the work so that it's worth switching to |
It's still interesting to implement cargo lint for this : ) |
https://github.com/rust-lang/rfcs/blob/master/text/2388-try-expr.md#breakage-of-the-try-macro lists good points about |
Deprecate `try!` macro Replaces rust-lang#62077 Fixes rust-lang/rust-clippy#1361 Fixes rust-lang#61000
The
?
operator has hit stable. We should lint all uses of the try macro and suggest the new operator instead.The text was updated successfully, but these errors were encountered: