about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-12-05 23:54:29 +0100
committerGitHub <noreply@github.com>2018-12-05 23:54:29 +0100
commit21ba28f1c626e650c886c822efc318084644f1e8 (patch)
treee084426ee0c988ac1cb70f37f42472f91d45a06c
parentb6e2fc9afff678644bbf1268cba880b9067b1f3c (diff)
parent0b40be696eb1f1756d38261de538015e8cfe7772 (diff)
downloadrust-21ba28f1c626e650c886c822efc318084644f1e8.tar.gz
rust-21ba28f1c626e650c886c822efc318084644f1e8.zip
Rollup merge of #56424 - mark-i-m:explain-raw, r=Centril
Mention raw-ident syntax

According to https://github.com/rust-lang/rust/pull/56419#pullrequestreview-180542790

Blocked on #56419

r? @Centril
-rw-r--r--src/libcore/macros.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 8b1855800c2..5ba0e949483 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -238,6 +238,10 @@ macro_rules! debug_assert_ne {
 /// with converting downstream errors.
 ///
 /// 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`.
+///
+/// [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
 /// expression has the value of the wrapped value.