const fn issue6067() {
    if let Ok(_) = Ok::<i32, i32>(42) {}

    if let Err(_) = Err::<i32, i32>(42) {}

    if let Some(_) = Some(42) {}

    if let None = None::<()> {}

    while let Ok(_) = Ok::<i32, i32>(10) {}

    while let Err(_) = Ok::<i32, i32>(10) {}

    while let Some(_) = Some(42) {}

    while let None = None::<()> {}

    match Ok::<i32, i32>(42) {
        Ok(_) => true,
        Err(_) => false,
    };

    match Err::<i32, i32>(42) {
        Ok(_) => false,
        Err(_) => true,
    };

    match Some(42) {
        Some(_) => true,
        None => false,
    };

    match None::<()> {
        Some(_) => false,
        None => true,
    };
}
// Methods that are unstable const should not be suggested within a const context, see issue #5697.
// However, in Rust 1.48.0 the methods `is_ok` and `is_err` of `Result`, and `is_some` and `is_none`
// of `Option` were stabilized as const, so the following should be linted.
Methods that are unstable const should not be suggested within a const context, see issue #5697.
Methods that are unstable const should not be suggested within a const context see issue #5697 .
const fn issue6067() {
    if let Ok(_) = Ok::<i32, i32>(42) {}
    if let Err(_) = Err::<i32, i32>(42) {}
    if let Some(_) = Some(42) {}
    if let None = None::<()> {}
    while let Ok(_) = Ok::<i32, i32>(10) {}
    while let Err(_) = Ok::<i32, i32>(10) {}
    while let Some(_) = Some(42) {}
    while let None = None::<()> {}
    match Ok::<i32, i32>(42) {
        Ok(_) => true,
        Err(_) => false,
    };
    match Err::<i32, i32>(42) {
        Ok(_) => false,
        Err(_) => true,
    };
    match Some(42) {
        Some(_) => true,
        None => false,
    };
    match None::<()> {
        Some(_) => false,
        None => true,
    };
}
const fn issue6067 ( ) { if let Ok ( _ ) = Ok :: < i32 , i32 > ( 42 ) { } if let Err ( _ ) = Err :: < i32 , i32 > ( 42 ) { } if let Some ( _ ) = Some ( 42 ) { } if let None = None :: < ( ) > { } while let Ok ( _ ) = Ok :: < i32 , i32 > ( 10 ) { } while let Err ( _ ) = Ok :: < i32 , i32 > ( 10 ) { } while let Some ( _ ) = Some ( 42 ) { } while let None = None :: < ( ) > { } match Ok :: < i32 , i32 > ( 42 ) { Ok ( _ ) => true , Err ( _ ) => false , } ; match Err :: < i32 , i32 > ( 42 ) { Ok ( _ ) => false , Err ( _ ) => true , } ; match Some ( 42 ) { Some ( _ ) => true , None => false , } ; match None :: < ( ) > { Some ( _ ) => false , None => true , } ; }
Methods that are unstable const should not be suggested within a const context, see issue #5697.
Methods that are unstable const should not be suggested within a const context see issue #5697 .