2011-09-26 10:26:30 -07:00
|
|
|
// Just a grab bag of stuff that you wouldn't want to actually write.
|
2011-08-18 22:16:54 -07:00
|
|
|
|
2012-04-30 10:37:58 -07:00
|
|
|
fn strange() -> bool { let _x: bool = ret true; }
|
2011-08-18 22:16:54 -07:00
|
|
|
|
|
|
|
fn funny() {
|
2011-08-19 15:16:48 -07:00
|
|
|
fn f(_x: ()) { }
|
2011-08-18 22:16:54 -07:00
|
|
|
f(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn what() {
|
2012-03-26 18:35:18 -07:00
|
|
|
fn the(x: @mut bool) { ret while !*x { *x = true; }; }
|
|
|
|
let i = @mut false;
|
2012-06-19 19:34:01 -07:00
|
|
|
let dont = {||the(i)};
|
2011-08-18 22:16:54 -07:00
|
|
|
dont();
|
2011-08-19 15:16:48 -07:00
|
|
|
assert (*i);
|
2011-08-18 22:16:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zombiejesus() {
|
2012-05-10 14:06:19 -07:00
|
|
|
loop {
|
2011-09-15 21:24:24 -07:00
|
|
|
while (ret) {
|
|
|
|
if (ret) {
|
2012-03-26 12:53:34 -07:00
|
|
|
alt (ret) {
|
2012-04-30 10:37:58 -07:00
|
|
|
1 {
|
2012-01-29 22:58:16 -05:00
|
|
|
if (ret) {
|
|
|
|
ret
|
|
|
|
} else {
|
|
|
|
ret
|
|
|
|
}
|
|
|
|
}
|
2012-04-30 10:37:58 -07:00
|
|
|
_ { ret }
|
2012-01-29 22:58:16 -05:00
|
|
|
};
|
2011-09-15 21:24:24 -07:00
|
|
|
} else if (ret) {
|
|
|
|
ret;
|
|
|
|
}
|
|
|
|
}
|
2012-05-10 14:06:19 -07:00
|
|
|
if (ret) { break; }
|
|
|
|
}
|
2011-08-18 22:16:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn notsure() {
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut _x;
|
|
|
|
let mut _y = (_x = 0) == (_x = 0);
|
|
|
|
let mut _z = (_x <- 0) < (_x = 0);
|
2011-08-18 22:16:54 -07:00
|
|
|
let _a = (_x += 0) == (_x = 0);
|
|
|
|
let _b = (_y <-> _z) == (_y <-> _z);
|
|
|
|
}
|
|
|
|
|
|
|
|
fn hammertime() -> int {
|
2011-12-22 17:53:53 -08:00
|
|
|
let _x = log(debug, true == (ret 0));
|
2011-08-18 22:16:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn canttouchthis() -> uint {
|
2011-08-23 18:25:50 -07:00
|
|
|
pure fn p() -> bool { true }
|
2012-07-13 18:43:52 -07:00
|
|
|
let _a = (assert (true)) == (assert (p()));
|
|
|
|
let _c = (assert (p())) == ();
|
2012-04-30 10:37:58 -07:00
|
|
|
let _b: bool = (log(debug, 0) == (ret 0u));
|
2011-08-18 22:16:54 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
fn angrydome() {
|
2012-03-09 16:11:56 -08:00
|
|
|
loop { if break { } }
|
2012-03-22 08:39:41 -07:00
|
|
|
let mut i = 0;
|
2012-07-09 15:15:32 -07:00
|
|
|
loop { i += 1; if i == 1 { alt check again { 1 { } } } break; }
|
2011-08-18 22:16:54 -07:00
|
|
|
}
|
|
|
|
|
2012-07-30 16:01:07 -07:00
|
|
|
fn evil_lincoln() { let evil <- debug!{"lincoln"}; }
|
2011-08-18 22:16:54 -07:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
strange();
|
|
|
|
funny();
|
|
|
|
what();
|
|
|
|
zombiejesus();
|
|
|
|
notsure();
|
|
|
|
hammertime();
|
|
|
|
canttouchthis();
|
|
|
|
angrydome();
|
|
|
|
evil_lincoln();
|
|
|
|
}
|