diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2016-10-06 11:36:36 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2016-10-12 08:40:22 +1300 |
| commit | 9bc6d2609233cece91803a8163dc3ba5579dfde8 (patch) | |
| tree | c02ea412e8c99997b845f8babd2f9e828ed26277 /src/libcore | |
| parent | 9d4d0da7af77858f268a66ff144134945c880560 (diff) | |
Stabilise `?`
cc [`?` tracking issue](https://github.com/rust-lang/rust/issues/31436)
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/lib.rs | 2 | ||||
| -rw-r--r-- | src/libcore/macros.rs | 3 |
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. /// |
