-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
stabilise ?, attributes on stmts, deprecate Reflect #36995
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, not sure if libs/lang team folks need to sign off. r=me otherwise
found enum `core::result::Result`) [E0308] | ||
``` | ||
|
||
`try!` returns a `Result<T, E>`, and so the function must. But `main()` has |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doesn't this text apply to ?
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe he removed it because its not accurate anymore: #36988
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, annoyingly you get an error message about the Carrier trait
@@ -255,6 +255,9 @@ macro_rules! debug_assert_ne { | |||
/// Helper macro for reducing boilerplate code for matching `Result` together | |||
/// with converting downstream errors. | |||
/// | |||
/// Prefer using `?` syntax to `try!`. `?` is built in to the language and is | |||
/// more succinct than `try!`, it is the standard method for error propogation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
propogation -> propagation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
is built in to the language and is more succinct thantry!
, it is the standard method for error propogation.
These are two separate sentences and probably shouldn't be separated by a comma.
For the sake of cross-linking, here's the link to the tracking issue: #31436 |
☔ The latest upstream changes (presumably #36945) made this pull request unmergeable. Please resolve the merge conflicts. |
This looks good to me, though I do think we ought to try and address #36988. |
@bors r+ |
📌 Commit adb4e2f has been approved by |
What's the type inference situation? It used to be that replacing Has this been cratered to look for such issues? |
@bluss good point, I had mis-remembered this issue. We have indeed done a bunch of Crater runs, but to test whether @bors: r- |
cc [`?` tracking issue](rust-lang#31436)
Note that attributes on expressions are still unstable and are behind the `stmt_expr_attributes` flag. cc [Tracking issue](rust-lang#15701)
[tracking issue](rust-lang#27749)
📌 Commit 79b5177 has been approved by |
stabilise ?, attributes on stmts, deprecate Reflect r? @nikomatsakis
Reflect is no longer required as of rust-lang/rust#36995.
r? @nikomatsakis