2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2012-11-14 19:28:43 -08:00
|
|
|
fn test1() {
|
2015-01-25 22:05:03 +01:00
|
|
|
let mut ints = [0; 32];
|
2012-11-14 19:28:43 -08:00
|
|
|
ints[0] += 1;
|
2013-05-18 22:02:45 -04:00
|
|
|
assert_eq!(ints[0], 1);
|
2012-11-14 19:28:43 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test2() {
|
2015-01-25 22:05:03 +01:00
|
|
|
let mut ints = [0; 32];
|
2015-01-31 20:02:00 -05:00
|
|
|
for i in &mut ints { *i += 22; }
|
2015-06-07 21:00:38 +03:00
|
|
|
for i in &ints { assert_eq!(*i, 22); }
|
2012-11-14 19:28:43 -08:00
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-11-14 19:28:43 -08:00
|
|
|
test1();
|
|
|
|
test2();
|
|
|
|
}
|