From 5152a6f2852f5200665a591bbf59e7e827a68af4 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Sun, 1 Apr 2018 22:11:51 -0600 Subject: [PATCH 1/2] Stabilize `Option::filter`. Fixes #45860 --- src/libcore/option.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 61ef6798b2efb..002fe68ad9b4c 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -639,7 +639,7 @@ impl Option { /// assert_eq!(Some(4).filter(is_even), Some(4)); /// ``` #[inline] - #[unstable(feature = "option_filter", issue = "45860")] + #[stable(feature = "option_filter", since = "1.27.0")] pub fn filter bool>(self, predicate: P) -> Self { if let Some(x) = self { if predicate(&x) { From c7ac32a1c1b35cb2206d9f09549cf93ef8b31e76 Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Thu, 5 Apr 2018 00:02:33 -0600 Subject: [PATCH 2/2] Remove uses of option_filter feature --- src/libcore/option.rs | 2 -- src/librustc_typeck/lib.rs | 1 - 2 files changed, 3 deletions(-) diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 002fe68ad9b4c..0dfdabee03182 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -628,8 +628,6 @@ impl Option { /// # Examples /// /// ```rust - /// #![feature(option_filter)] - /// /// fn is_even(n: &i32) -> bool { /// n % 2 == 0 /// } diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 44ecb32a0bf9b..b1431f44cda0e 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -81,7 +81,6 @@ This API is completely unstable and subject to change. #![feature(from_ref)] #![cfg_attr(stage0, feature(match_default_bindings))] #![feature(exhaustive_patterns)] -#![feature(option_filter)] #![feature(quote)] #![feature(refcell_replace_swap)] #![feature(rustc_diagnostic_macros)]