2019-07-26 21:54:25 +00:00
|
|
|
// run-pass
|
|
|
|
|
2018-09-14 10:20:28 +00:00
|
|
|
#![allow(non_camel_case_types)]
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
type point = (isize, isize);
|
2011-08-15 11:39:45 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
fn f(p: point, x: isize, y: isize) {
|
2011-08-15 11:39:45 +00:00
|
|
|
let (a, b) = p;
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(a, x);
|
|
|
|
assert_eq!(b, y);
|
2011-08-15 11:39:45 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2011-08-15 11:39:45 +00:00
|
|
|
let p: point = (10, 20);
|
|
|
|
let (a, b) = p;
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(a, 10);
|
|
|
|
assert_eq!(b, 20);
|
2011-08-15 11:39:45 +00:00
|
|
|
let p2: point = p;
|
|
|
|
f(p, 10, 20);
|
|
|
|
f(p2, 10, 20);
|
2011-08-19 22:16:48 +00:00
|
|
|
}
|