about summary refs log tree commit diff
path: root/src/test/run-pass/try-from-int-error-partial-eq.rs
blob: 83ede6759257d113b3b6caa72020affc67243ca2 (plain)
1
2
3
4
5
6
7
8
9
10
11
#![feature(try_from)]
#![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);
}