summary refs log tree commit diff
path: root/tests/ui/try-from-int-error-partial-eq.rs
blob: 66a78b3f842fb9fd6ca3ee215e60915d5d892b1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ run-pass

#![allow(unused_must_use)]

use std::convert::TryFrom;
use std::num::TryFromIntError;

fn main() {
    let x: u32 = 125;
    let y: Result<u8, TryFromIntError> = u8::try_from(x);
    y == Ok(125);
}