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") }