mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-16 14:07:04 +00:00
Rollup merge of #101229 - mgeisler:link-try-operator, r=thomcc
Link “? operator” to relevant chapter in The Book Before, the text simply asked people to use a symbol which is hard to search for. Now the text links back to the chapter on error propagation in The Book. That should help people find the relevant keywords for further searches.
This commit is contained in:
commit
c30c42ee29
@ -350,10 +350,12 @@ macro_rules! matches {
|
||||
|
||||
/// Unwraps a result or propagates its error.
|
||||
///
|
||||
/// The `?` operator was added to replace `try!` and should be used instead.
|
||||
/// Furthermore, `try` is a reserved word in Rust 2018, so if you must use
|
||||
/// it, you will need to use the [raw-identifier syntax][ris]: `r#try`.
|
||||
/// The [`?` operator][propagating-errors] was added to replace `try!`
|
||||
/// and should be used instead. Furthermore, `try` is a reserved word
|
||||
/// in Rust 2018, so if you must use it, you will need to use the
|
||||
/// [raw-identifier syntax][ris]: `r#try`.
|
||||
///
|
||||
/// [propagating-errors]: https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html#a-shortcut-for-propagating-errors-the--operator
|
||||
/// [ris]: https://doc.rust-lang.org/nightly/rust-by-example/compatibility/raw_identifiers.html
|
||||
///
|
||||
/// `try!` matches the given [`Result`]. In case of the `Ok` variant, the
|
||||
|
Loading…
Reference in New Issue
Block a user