summaryrefslogtreecommitdiffstats
path: root/src/test/ui/try-from-int-error-partial-eq.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/try-from-int-error-partial-eq.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/try-from-int-error-partial-eq.rs b/src/test/ui/try-from-int-error-partial-eq.rs
new file mode 100644
index 000000000..6ee4a4cf3
--- /dev/null
+++ b/src/test/ui/try-from-int-error-partial-eq.rs
@@ -0,0 +1,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);
+}