2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2010-06-24 04:03:09 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
struct Point {x: isize, y: isize}
|
2010-06-24 04:03:09 +00:00
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2013-01-26 06:46:32 +00:00
|
|
|
let origin: Point = Point {x: 0, y: 0};
|
|
|
|
let right: Point = Point {x: origin.x + 10,.. origin};
|
|
|
|
let up: Point = Point {y: origin.y + 10,.. origin};
|
2013-05-19 02:02:45 +00:00
|
|
|
assert_eq!(origin.x, 0);
|
|
|
|
assert_eq!(origin.y, 0);
|
|
|
|
assert_eq!(right.x, 10);
|
|
|
|
assert_eq!(right.y, 0);
|
|
|
|
assert_eq!(up.x, 0);
|
|
|
|
assert_eq!(up.y, 10);
|
2011-08-19 22:16:48 +00:00
|
|
|
}
|