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