mirror of
https://git.proxmox.com/git/rustc
synced 2026-01-24 00:34:20 +00:00
13 lines
213 B
Rust
13 lines
213 B
Rust
//@ 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);
|
|
}
|