2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-08-31 08:02:01 -05:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
type an_int = isize;
|
2012-05-30 12:38:58 -05:00
|
|
|
|
2015-03-25 19:06:52 -05:00
|
|
|
fn cmp(x: Option<an_int>, y: Option<isize>) -> bool {
|
2012-05-30 12:38:58 -05:00
|
|
|
x == y
|
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2013-03-28 20:39:09 -05:00
|
|
|
assert!(!cmp(Some(3), None));
|
|
|
|
assert!(!cmp(Some(3), Some(4)));
|
|
|
|
assert!(cmp(Some(3), Some(3)));
|
|
|
|
assert!(cmp(None, None));
|
2013-02-14 13:47:00 -06:00
|
|
|
}
|