From 5d31a818df97e8a71545e5ba6de0627abb7837ee Mon Sep 17 00:00:00 2001 From: Devon Hollowood Date: Fri, 21 Oct 2016 14:29:42 -0700 Subject: [PATCH] Fix use of `result_unwrap_or_default` feature --- src/libcore/result.rs | 2 ++ src/libcoretest/lib.rs | 1 + src/libcoretest/result.rs | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcore/result.rs b/src/libcore/result.rs index f4973b3a254ba..e7768106aa6ad 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -807,6 +807,8 @@ impl Result { /// `Err` on error. /// /// ``` + /// #![feature(result_unwrap_or_default)] + /// /// let good_year_from_input = "1909"; /// let bad_year_from_input = "190blarg"; /// let good_year = good_year_from_input.parse().unwrap_or_default(); diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index 590bf478aa723..cdbc214731806 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -34,6 +34,7 @@ #![feature(unique)] #![feature(iter_max_by)] #![feature(iter_min_by)] +#![feature(result_unwrap_or_default)] extern crate core; extern crate test; diff --git a/src/libcoretest/result.rs b/src/libcoretest/result.rs index f80cb8d520736..bc2cd8bbfc651 100644 --- a/src/libcoretest/result.rs +++ b/src/libcoretest/result.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(result_unwrap_or_default)] - fn op1() -> Result { Ok(666) } fn op2() -> Result { Err("sadface") }