blob: 66a78b3f842fb9fd6ca3ee215e60915d5d892b1e [file] [log] [blame]
许杰友 Jieyou Xu (Joe)ec2cc762024-02-16 20:02:501//@ run-pass
Vadim Petrochenkovca9faa52019-07-26 21:54:252
Guillaume Gomezda4febd2018-08-18 21:24:253#![allow(unused_must_use)]
4
5use std::convert::TryFrom;
6use std::num::TryFromIntError;
7
8fn main() {
9 let x: u32 = 125;
10 let y: Result<u8, TryFromIntError> = u8::try_from(x);
11 y == Ok(125);
12}