1 #![feature(custom_attribute)]
2 #![allow(dead_code, unused_attributes)]
4 #[derive(Debug, PartialEq)]
5 enum Unit { Unit(()) } // Force non-C-enum representation.
8 fn return_unit() -> Unit {
12 #[derive(Debug, PartialEq)]
13 enum MyBool { False(()), True(()) } // Force non-C-enum representation.
16 fn return_true() -> MyBool {
21 fn return_false() -> MyBool {
26 fn return_none() -> Option<i64> {
31 fn return_some() -> Option<i64> {
36 fn match_opt_none() -> i8 {
45 fn match_opt_some() -> i8 {
54 fn two_nones() -> (Option<i16>, Option<i16>) {
60 //assert_eq!(two_nones(), (None, None));
61 assert_eq!(match_opt_some(), 13);
62 assert_eq!(match_opt_none(), 42);
63 //assert_eq!(return_some(), Some(42));
64 //assert_eq!(return_none(), None);
65 //assert_eq!(return_false(), MyBool::False);
66 //assert_eq!(return_true(), MyBool::True);
67 //assert_eq!(return_unit(), Unit::Unit);