@@ -479,19 +479,6 @@ impl<T> Option<T> {
479479 /// assert_eq!(Some(4).unwrap_or_else(|| 2 * k), 4);
480480 /// assert_eq!(None.unwrap_or_else(|| 2 * k), 20);
481481 /// ```
482- #[ rustc_const_unstable( feature = "const_option_match" ) ]
483- #[ cfg( not( bootstrap) ) ]
484- #[ inline]
485- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
486- pub const fn unwrap_or_else < F : FnOnce ( ) -> T > ( self , f : F ) -> T {
487- match self {
488- Some ( x) => x,
489- None => f ( ) ,
490- }
491- }
492-
493- /// No docs for bootstrap.
494- #[ cfg( bootstrap) ]
495482 #[ inline]
496483 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
497484 pub fn unwrap_or_else < F : FnOnce ( ) -> T > ( self , f : F ) -> T {
@@ -521,19 +508,6 @@ impl<T> Option<T> {
521508 ///
522509 /// assert_eq!(maybe_some_len, Some(13));
523510 /// ```
524- #[ rustc_const_unstable( feature = "const_option_match" ) ]
525- #[ cfg( not( bootstrap) ) ]
526- #[ inline]
527- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
528- pub const fn map < U , F : FnOnce ( T ) -> U > ( self , f : F ) -> Option < U > {
529- match self {
530- Some ( x) => Some ( f ( x) ) ,
531- None => None ,
532- }
533- }
534-
535- /// No docs for bootstrap.
536- #[ cfg( bootstrap) ]
537511 #[ inline]
538512 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
539513 pub fn map < U , F : FnOnce ( T ) -> U > ( self , f : F ) -> Option < U > {
@@ -555,19 +529,6 @@ impl<T> Option<T> {
555529 /// let x: Option<&str> = None;
556530 /// assert_eq!(x.map_or(42, |v| v.len()), 42);
557531 /// ```
558- #[ rustc_const_unstable( feature = "const_option_match" ) ]
559- #[ cfg( not( bootstrap) ) ]
560- #[ inline]
561- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
562- pub const fn map_or < U , F : FnOnce ( T ) -> U > ( self , default : U , f : F ) -> U {
563- match self {
564- Some ( t) => f ( t) ,
565- None => default,
566- }
567- }
568-
569- /// No docs for bootstrap.
570- #[ cfg( bootstrap) ]
571532 #[ inline]
572533 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
573534 pub fn map_or < U , F : FnOnce ( T ) -> U > ( self , default : U , f : F ) -> U {
@@ -591,19 +552,6 @@ impl<T> Option<T> {
591552 /// let x: Option<&str> = None;
592553 /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42);
593554 /// ```
594- #[ rustc_const_unstable( feature = "const_option_match" ) ]
595- #[ cfg( not( bootstrap) ) ]
596- #[ inline]
597- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
598- pub const fn map_or_else < U , D : FnOnce ( ) -> U , F : FnOnce ( T ) -> U > ( self , default : D , f : F ) -> U {
599- match self {
600- Some ( t) => f ( t) ,
601- None => default ( ) ,
602- }
603- }
604-
605- /// No docs for bootstrap.
606- #[ cfg( bootstrap) ]
607555 #[ inline]
608556 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
609557 pub fn map_or_else < U , D : FnOnce ( ) -> U , F : FnOnce ( T ) -> U > ( self , default : D , f : F ) -> U {
@@ -676,19 +624,6 @@ impl<T> Option<T> {
676624 /// let x: Option<&str> = None;
677625 /// assert_eq!(x.ok_or_else(|| 0), Err(0));
678626 /// ```
679- #[ rustc_const_unstable( feature = "const_option_match" ) ]
680- #[ cfg( not( bootstrap) ) ]
681- #[ inline]
682- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
683- pub const fn ok_or_else < E , F : FnOnce ( ) -> E > ( self , err : F ) -> Result < T , E > {
684- match self {
685- Some ( v) => Ok ( v) ,
686- None => Err ( err ( ) ) ,
687- }
688- }
689-
690- /// No docs for bootstrap.
691- #[ cfg( bootstrap) ]
692627 #[ inline]
693628 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
694629 pub fn ok_or_else < E , F : FnOnce ( ) -> E > ( self , err : F ) -> Result < T , E > {
@@ -807,19 +742,6 @@ impl<T> Option<T> {
807742 /// assert_eq!(Some(2).and_then(nope).and_then(sq), None);
808743 /// assert_eq!(None.and_then(sq).and_then(sq), None);
809744 /// ```
810- #[ rustc_const_unstable( feature = "const_option_match" ) ]
811- #[ cfg( not( bootstrap) ) ]
812- #[ inline]
813- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
814- pub const fn and_then < U , F : FnOnce ( T ) -> Option < U > > ( self , f : F ) -> Option < U > {
815- match self {
816- Some ( x) => f ( x) ,
817- None => None ,
818- }
819- }
820-
821- /// No docs for bootstrap.
822- #[ cfg( bootstrap) ]
823745 #[ inline]
824746 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
825747 pub fn and_then < U , F : FnOnce ( T ) -> Option < U > > ( self , f : F ) -> Option < U > {
@@ -855,21 +777,6 @@ impl<T> Option<T> {
855777 /// [`None`]: #variant.None
856778 /// [`Some(t)`]: #variant.Some
857779 /// [`Iterator::filter()`]: ../../std/iter/trait.Iterator.html#method.filter
858- #[ rustc_const_unstable( feature = "const_option_match" ) ]
859- #[ cfg( not( bootstrap) ) ]
860- #[ inline]
861- #[ stable( feature = "option_filter" , since = "1.27.0" ) ]
862- pub const fn filter < P : FnOnce ( & T ) -> bool > ( self , predicate : P ) -> Self {
863- if let Some ( x) = self {
864- if predicate ( & x) {
865- return Some ( x) ;
866- }
867- }
868- None
869- }
870-
871- /// No docs for bootstrap.
872- #[ cfg( bootstrap) ]
873780 #[ inline]
874781 #[ stable( feature = "option_filter" , since = "1.27.0" ) ]
875782 pub fn filter < P : FnOnce ( & T ) -> bool > ( self , predicate : P ) -> Self {
@@ -943,19 +850,6 @@ impl<T> Option<T> {
943850 /// assert_eq!(None.or_else(vikings), Some("vikings"));
944851 /// assert_eq!(None.or_else(nobody), None);
945852 /// ```
946- #[ rustc_const_unstable( feature = "const_option_match" ) ]
947- #[ cfg( not( bootstrap) ) ]
948- #[ inline]
949- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
950- pub const fn or_else < F : FnOnce ( ) -> Option < T > > ( self , f : F ) -> Option < T > {
951- match self {
952- Some ( _) => self ,
953- None => f ( ) ,
954- }
955- }
956-
957- /// No docs for bootstrap.
958- #[ cfg( bootstrap) ]
959853 #[ inline]
960854 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
961855 pub fn or_else < F : FnOnce ( ) -> Option < T > > ( self , f : F ) -> Option < T > {
0 commit comments