summaryrefslogtreecommitdiffstats
path: root/tests/ui/try-from-int-error-partial-eq.rs
blob: 6ee4a4cf319244ece0f87086ee817c45808cd82c (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);
}