@@ -278,9 +278,10 @@ impl<T, E> Result<T, E> {
278278 /// assert_eq!(x.is_ok(), false);
279279 /// ```
280280 #[ must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead" ]
281+ #[ rustc_const_unstable( feature = "const_result" , issue = "67520" ) ]
281282 #[ inline]
282283 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
283- pub fn is_ok ( & self ) -> bool {
284+ pub const fn is_ok ( & self ) -> bool {
284285 match * self {
285286 Ok ( _) => true ,
286287 Err ( _) => false ,
@@ -303,9 +304,10 @@ impl<T, E> Result<T, E> {
303304 /// assert_eq!(x.is_err(), true);
304305 /// ```
305306 #[ must_use = "if you intended to assert that this is err, consider `.unwrap_err()` instead" ]
307+ #[ rustc_const_unstable( feature = "const_result" , issue = "67520" ) ]
306308 #[ inline]
307309 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
308- pub fn is_err ( & self ) -> bool {
310+ pub const fn is_err ( & self ) -> bool {
309311 !self . is_ok ( )
310312 }
311313
@@ -446,8 +448,9 @@ impl<T, E> Result<T, E> {
446448 /// assert_eq!(x.as_ref(), Err(&"Error"));
447449 /// ```
448450 #[ inline]
451+ #[ rustc_const_unstable( feature = "const_result" , issue = "67520" ) ]
449452 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
450- pub fn as_ref ( & self ) -> Result < & T , & E > {
453+ pub const fn as_ref ( & self ) -> Result < & T , & E > {
451454 match * self {
452455 Ok ( ref x) => Ok ( x) ,
453456 Err ( ref x) => Err ( x) ,
0 commit comments