about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2016-10-06 11:36:36 +1300
committerNick Cameron <ncameron@mozilla.com>2016-10-12 08:40:22 +1300
commit9bc6d2609233cece91803a8163dc3ba5579dfde8 (patch)
treec02ea412e8c99997b845f8babd2f9e828ed26277 /src/libcore
parent9d4d0da7af77858f268a66ff144134945c880560 (diff)
Stabilise `?`
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/lib.rs2
-rw-r--r--src/libcore/macros.rs3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index 1ae4cf8e5ef..28101d21fc2 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -89,7 +89,7 @@
 #![feature(specialization)]
 #![feature(staged_api)]
 #![feature(unboxed_closures)]
-#![feature(question_mark)]
+#![cfg_attr(stage0, feature(question_mark))]
 #![feature(never_type)]
 #![feature(prelude_import)]
 
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs
index 99c24e4c48d..a0768089d52 100644
--- a/src/libcore/macros.rs
+++ b/src/libcore/macros.rs
@@ -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.
+///
 /// `try!` matches the given `Result`. In case of the `Ok` variant, the
 /// expression has the value of the wrapped value.
 ///